Browse Source

formatting code by: goimports -w=true .

pull/22/head
Chris Lu 10 years ago
parent
commit
179d36ba0e
  1. 6
      go/filer/client_operations.go
  2. 2
      go/filer/directory.go
  3. 3
      go/filer/directory_in_map.go
  4. 2
      go/filer/filer.go
  5. 3
      go/filer/filer_embedded.go
  6. 1
      go/filer/files_in_leveldb.go
  7. 2
      go/glog/convenient_api.go
  8. 3
      go/images/orientation.go
  9. 3
      go/images/resizing.go
  10. 5
      go/operation/assign_file_id.go
  11. 2
      go/operation/data_struts.go
  12. 3
      go/operation/delete_content.go
  13. 3
      go/operation/list_masters.go
  14. 3
      go/operation/lookup.go
  15. 3
      go/operation/submit.go
  16. 3
      go/operation/system_message_test.go
  17. 3
      go/operation/upload_content.go
  18. 2
      go/sequence/sequence.go
  19. 2
      go/stats/disk.go
  20. 2
      go/stats/disk_notsupported.go
  21. 2
      go/stats/memory_notsupported.go
  22. 5
      go/storage/cdb_map.go
  23. 3
      go/storage/cdb_map_test.go
  24. 2
      go/storage/compact_map.go
  25. 5
      go/storage/compact_map_perf_test.go
  26. 3
      go/storage/compress.go
  27. 3
      go/storage/crc.go
  28. 5
      go/storage/file_id.go
  29. 7
      go/storage/needle.go
  30. 5
      go/storage/needle_map.go
  31. 5
      go/storage/needle_read_write.go
  32. 9
      go/storage/store.go
  33. 3
      go/storage/store_vacuum.go
  34. 3
      go/storage/volume.go
  35. 3
      go/storage/volume_super_block.go
  36. 3
      go/storage/volume_vacuum.go
  37. 2
      go/storage/volume_version.go
  38. 3
      go/tools/read_index.go
  39. 5
      go/topology/allocate_volume.go
  40. 2
      go/topology/data_center.go
  41. 3
      go/topology/data_node.go
  42. 5
      go/topology/node.go
  43. 5
      go/topology/store_replicate.go
  44. 7
      go/topology/topology.go
  45. 5
      go/topology/topology_event_handling.go
  46. 2
      go/topology/topology_map.go
  47. 7
      go/topology/topology_vacuum.go
  48. 5
      go/topology/volume_growth.go
  49. 5
      go/topology/volume_growth_test.go
  50. 5
      go/topology/volume_layout.go
  51. 2
      go/topology/volume_location_list.go
  52. 3
      go/util/config.go
  53. 2
      go/util/constants.go
  54. 3
      go/util/file_util.go
  55. 3
      go/util/net_timeout.go
  56. 7
      go/weed/benchmark.go
  57. 5
      go/weed/download.go
  58. 5
      go/weed/export.go
  59. 7
      go/weed/filer.go
  60. 5
      go/weed/fix.go
  61. 9
      go/weed/master.go
  62. 2
      go/weed/mount.go
  63. 7
      go/weed/mount_std.go
  64. 9
      go/weed/server.go
  65. 3
      go/weed/shell.go
  66. 2
      go/weed/signal_handling_notsupported.go
  67. 3
      go/weed/upload.go
  68. 3
      go/weed/version.go
  69. 7
      go/weed/volume.go
  70. 3
      go/weed/volume_test.go
  71. 3
      go/weed/weed.go
  72. 11
      go/weed/weed_server/common.go
  73. 5
      go/weed/weed_server/filer_server.go
  74. 9
      go/weed/weed_server/filer_server_handlers.go
  75. 3
      go/weed/weed_server/filer_server_handlers_admin.go
  76. 9
      go/weed/weed_server/master_server.go
  77. 7
      go/weed/weed_server/master_server_handlers.go
  78. 13
      go/weed/weed_server/master_server_handlers_admin.go
  79. 9
      go/weed/weed_server/raft_server.go
  80. 7
      go/weed/weed_server/raft_server_handlers.go
  81. 5
      go/weed/weed_server/volume_server.go
  82. 13
      go/weed/weed_server/volume_server_handlers.go
  83. 5
      go/weed/weed_server/volume_server_handlers_admin.go
  84. 3
      go/weed/weed_server/volume_server_handlers_vacuum.go

6
go/filer/client_operations.go

@ -1,12 +1,12 @@
package filer package filer
import ()
import ( import (
"github.com/chrislusf/weed-fs/go/util"
"encoding/json" "encoding/json"
"errors" "errors"
"fmt" "fmt"
"github.com/chrislusf/weed-fs/go/util"
"net/url" "net/url"
) )

2
go/filer/directory.go

@ -1,7 +1,5 @@
package filer package filer
import ()
type DirectoryId int32 type DirectoryId int32
type DirectoryEntry struct { type DirectoryEntry struct {

3
go/filer/directory_in_map.go

@ -2,7 +2,6 @@ package filer
import ( import (
"bufio" "bufio"
"github.com/chrislusf/weed-fs/go/util"
"fmt" "fmt"
"io" "io"
"os" "os"
@ -10,6 +9,8 @@ import (
"strconv" "strconv"
"strings" "strings"
"sync" "sync"
"github.com/chrislusf/weed-fs/go/util"
) )
var writeLock sync.Mutex //serialize changes to dir.log var writeLock sync.Mutex //serialize changes to dir.log

2
go/filer/filer.go

@ -1,7 +1,5 @@
package filer package filer
import ()
type FileId string //file id on weedfs type FileId string //file id on weedfs
type FileEntry struct { type FileEntry struct {

3
go/filer/filer_embedded.go

@ -1,11 +1,12 @@
package filer package filer
import ( import (
"github.com/chrislusf/weed-fs/go/operation"
"errors" "errors"
"fmt" "fmt"
"path/filepath" "path/filepath"
"strings" "strings"
"github.com/chrislusf/weed-fs/go/operation"
) )
type FilerEmbedded struct { type FilerEmbedded struct {

1
go/filer/files_in_leveldb.go

@ -2,6 +2,7 @@ package filer
import ( import (
"bytes" "bytes"
"github.com/chrislusf/weed-fs/go/glog" "github.com/chrislusf/weed-fs/go/glog"
"github.com/syndtr/goleveldb/leveldb" "github.com/syndtr/goleveldb/leveldb"
"github.com/syndtr/goleveldb/leveldb/util" "github.com/syndtr/goleveldb/leveldb/util"

2
go/glog/convenient_api.go

@ -1,7 +1,5 @@
package glog package glog
import ()
/* /*
Copying the original glog because it is missing several convenient methods. Copying the original glog because it is missing several convenient methods.
1. remove nano time in log format 1. remove nano time in log format

3
go/images/orientation.go

@ -2,11 +2,12 @@ package images
import ( import (
"bytes" "bytes"
"github.com/rwcarlsen/goexif/exif"
"image" "image"
"image/draw" "image/draw"
"image/jpeg" "image/jpeg"
"log" "log"
"github.com/rwcarlsen/goexif/exif"
) )
//many code is copied from http://camlistore.org/pkg/images/images.go //many code is copied from http://camlistore.org/pkg/images/images.go

3
go/images/resizing.go

@ -2,11 +2,12 @@ package images
import ( import (
"bytes" "bytes"
"github.com/disintegration/imaging"
"image" "image"
"image/gif" "image/gif"
"image/jpeg" "image/jpeg"
"image/png" "image/png"
"github.com/disintegration/imaging"
) )
func Resized(ext string, data []byte, width, height int) (resized []byte, w int, h int) { func Resized(ext string, data []byte, width, height int) (resized []byte, w int, h int) {

5
go/operation/assign_file_id.go

@ -1,12 +1,13 @@
package operation package operation
import ( import (
"github.com/chrislusf/weed-fs/go/glog"
"github.com/chrislusf/weed-fs/go/util"
"encoding/json" "encoding/json"
"errors" "errors"
"net/url" "net/url"
"strconv" "strconv"
"github.com/chrislusf/weed-fs/go/glog"
"github.com/chrislusf/weed-fs/go/util"
) )
type AssignResult struct { type AssignResult struct {

2
go/operation/data_struts.go

@ -1,7 +1,5 @@
package operation package operation
import ()
type JoinResult struct { type JoinResult struct {
VolumeSizeLimit uint64 `json:"VolumeSizeLimit,omitempty"` VolumeSizeLimit uint64 `json:"VolumeSizeLimit,omitempty"`
Error string `json:"error,omitempty"` Error string `json:"error,omitempty"`

3
go/operation/delete_content.go

@ -1,12 +1,13 @@
package operation package operation
import ( import (
"github.com/chrislusf/weed-fs/go/util"
"encoding/json" "encoding/json"
"errors" "errors"
"net/url" "net/url"
"strings" "strings"
"sync" "sync"
"github.com/chrislusf/weed-fs/go/util"
) )
type DeleteResult struct { type DeleteResult struct {

3
go/operation/list_masters.go

@ -1,9 +1,10 @@
package operation package operation
import ( import (
"encoding/json"
"github.com/chrislusf/weed-fs/go/glog" "github.com/chrislusf/weed-fs/go/glog"
"github.com/chrislusf/weed-fs/go/util" "github.com/chrislusf/weed-fs/go/util"
"encoding/json"
) )
type ClusterStatusResult struct { type ClusterStatusResult struct {

3
go/operation/lookup.go

@ -1,7 +1,6 @@
package operation package operation
import ( import (
"github.com/chrislusf/weed-fs/go/util"
"encoding/json" "encoding/json"
"errors" "errors"
_ "fmt" _ "fmt"
@ -9,6 +8,8 @@ import (
"net/url" "net/url"
"strings" "strings"
"time" "time"
"github.com/chrislusf/weed-fs/go/util"
) )
type Location struct { type Location struct {

3
go/operation/submit.go

@ -2,13 +2,14 @@ package operation
import ( import (
"bytes" "bytes"
"github.com/chrislusf/weed-fs/go/glog"
"io" "io"
"mime" "mime"
"os" "os"
"path" "path"
"strconv" "strconv"
"strings" "strings"
"github.com/chrislusf/weed-fs/go/glog"
) )
type FilePart struct { type FilePart struct {

3
go/operation/system_message_test.go

@ -1,10 +1,11 @@
package operation package operation
import ( import (
proto "code.google.com/p/goprotobuf/proto"
"encoding/json" "encoding/json"
"log" "log"
"testing" "testing"
proto "code.google.com/p/goprotobuf/proto"
) )
func TestSerialDeserial(t *testing.T) { func TestSerialDeserial(t *testing.T) {

3
go/operation/upload_content.go

@ -2,7 +2,6 @@ package operation
import ( import (
"bytes" "bytes"
"github.com/chrislusf/weed-fs/go/glog"
"encoding/json" "encoding/json"
"errors" "errors"
"fmt" "fmt"
@ -14,6 +13,8 @@ import (
"net/textproto" "net/textproto"
"path/filepath" "path/filepath"
"strings" "strings"
"github.com/chrislusf/weed-fs/go/glog"
) )
type UploadResult struct { type UploadResult struct {

2
go/sequence/sequence.go

@ -1,7 +1,5 @@
package sequence package sequence
import ()
type Sequencer interface { type Sequencer interface {
NextFileId(count int) (uint64, int) NextFileId(count int) (uint64, int)
SetMax(uint64) SetMax(uint64)

2
go/stats/disk.go

@ -1,7 +1,5 @@
package stats package stats
import ()
type DiskStatus struct { type DiskStatus struct {
Dir string Dir string
All uint64 All uint64

2
go/stats/disk_notsupported.go

@ -2,8 +2,6 @@
package stats package stats
import ()
func (disk *DiskStatus) fillInStatus() { func (disk *DiskStatus) fillInStatus() {
return return
} }

2
go/stats/memory_notsupported.go

@ -2,8 +2,6 @@
package stats package stats
import ()
func (mem *MemStatus) fillInStatus() { func (mem *MemStatus) fillInStatus() {
return return
} }

5
go/storage/cdb_map.go

@ -1,13 +1,14 @@
package storage package storage
import ( import (
"github.com/chrislusf/weed-fs/go/util"
"encoding/json" "encoding/json"
"errors" "errors"
"fmt" "fmt"
"github.com/tgulacsi/go-cdb"
"os" "os"
"path/filepath" "path/filepath"
"github.com/chrislusf/weed-fs/go/util"
"github.com/tgulacsi/go-cdb"
) )
// CDB-backed read-only needle map // CDB-backed read-only needle map

3
go/storage/cdb_map_test.go

@ -1,11 +1,12 @@
package storage package storage
import ( import (
"github.com/chrislusf/weed-fs/go/glog"
"math/rand" "math/rand"
"os" "os"
"runtime" "runtime"
"testing" "testing"
"github.com/chrislusf/weed-fs/go/glog"
) )
var testIndexFilename string = "../../test/sample.idx" var testIndexFilename string = "../../test/sample.idx"

2
go/storage/compact_map.go

@ -1,7 +1,5 @@
package storage package storage
import ()
type NeedleValue struct { type NeedleValue struct {
Key Key Key Key
Offset uint32 `comment:"Volume offset"` //since aligned to 8 bytes, range is 4G*8=32G Offset uint32 `comment:"Volume offset"` //since aligned to 8 bytes, range is 4G*8=32G

5
go/storage/compact_map_perf_test.go

@ -1,11 +1,12 @@
package storage package storage
import ( import (
"github.com/chrislusf/weed-fs/go/glog"
"github.com/chrislusf/weed-fs/go/util"
"log" "log"
"os" "os"
"testing" "testing"
"github.com/chrislusf/weed-fs/go/glog"
"github.com/chrislusf/weed-fs/go/util"
) )
func TestMemoryUsage(t *testing.T) { func TestMemoryUsage(t *testing.T) {

3
go/storage/compress.go

@ -2,11 +2,12 @@ package storage
import ( import (
"bytes" "bytes"
"github.com/chrislusf/weed-fs/go/glog"
"compress/flate" "compress/flate"
"compress/gzip" "compress/gzip"
"io/ioutil" "io/ioutil"
"strings" "strings"
"github.com/chrislusf/weed-fs/go/glog"
) )
/* /*

3
go/storage/crc.go

@ -1,9 +1,10 @@
package storage package storage
import ( import (
"github.com/chrislusf/weed-fs/go/util"
"fmt" "fmt"
"hash/crc32" "hash/crc32"
"github.com/chrislusf/weed-fs/go/util"
) )
var table = crc32.MakeTable(crc32.Castagnoli) var table = crc32.MakeTable(crc32.Castagnoli)

5
go/storage/file_id.go

@ -1,11 +1,12 @@
package storage package storage
import ( import (
"github.com/chrislusf/weed-fs/go/glog"
"github.com/chrislusf/weed-fs/go/util"
"encoding/hex" "encoding/hex"
"errors" "errors"
"strings" "strings"
"github.com/chrislusf/weed-fs/go/glog"
"github.com/chrislusf/weed-fs/go/util"
) )
type FileId struct { type FileId struct {

7
go/storage/needle.go

@ -1,9 +1,6 @@
package storage package storage
import ( import (
"github.com/chrislusf/weed-fs/go/glog"
"github.com/chrislusf/weed-fs/go/images"
"github.com/chrislusf/weed-fs/go/util"
"encoding/hex" "encoding/hex"
"errors" "errors"
"io/ioutil" "io/ioutil"
@ -13,6 +10,10 @@ import (
"strconv" "strconv"
"strings" "strings"
"time" "time"
"github.com/chrislusf/weed-fs/go/glog"
"github.com/chrislusf/weed-fs/go/images"
"github.com/chrislusf/weed-fs/go/util"
) )
const ( const (

5
go/storage/needle_map.go

@ -1,11 +1,12 @@
package storage package storage
import ( import (
"github.com/chrislusf/weed-fs/go/glog"
"github.com/chrislusf/weed-fs/go/util"
"fmt" "fmt"
"io" "io"
"os" "os"
"github.com/chrislusf/weed-fs/go/glog"
"github.com/chrislusf/weed-fs/go/util"
) )
type NeedleMapper interface { type NeedleMapper interface {

5
go/storage/needle_read_write.go

@ -1,12 +1,13 @@
package storage package storage
import ( import (
"github.com/chrislusf/weed-fs/go/glog"
"github.com/chrislusf/weed-fs/go/util"
"errors" "errors"
"fmt" "fmt"
"io" "io"
"os" "os"
"github.com/chrislusf/weed-fs/go/glog"
"github.com/chrislusf/weed-fs/go/util"
) )
const ( const (

9
go/storage/store.go

@ -1,10 +1,6 @@
package storage package storage
import ( import (
proto "code.google.com/p/goprotobuf/proto"
"github.com/chrislusf/weed-fs/go/glog"
"github.com/chrislusf/weed-fs/go/operation"
"github.com/chrislusf/weed-fs/go/util"
"encoding/json" "encoding/json"
"errors" "errors"
"fmt" "fmt"
@ -12,6 +8,11 @@ import (
"math/rand" "math/rand"
"strconv" "strconv"
"strings" "strings"
proto "code.google.com/p/goprotobuf/proto"
"github.com/chrislusf/weed-fs/go/glog"
"github.com/chrislusf/weed-fs/go/operation"
"github.com/chrislusf/weed-fs/go/util"
) )
const ( const (

3
go/storage/store_vacuum.go

@ -1,9 +1,10 @@
package storage package storage
import ( import (
"github.com/chrislusf/weed-fs/go/glog"
"fmt" "fmt"
"strconv" "strconv"
"github.com/chrislusf/weed-fs/go/glog"
) )
func (s *Store) CheckCompactVolume(volumeIdString string, garbageThresholdString string) (error, bool) { func (s *Store) CheckCompactVolume(volumeIdString string, garbageThresholdString string) (error, bool) {

3
go/storage/volume.go

@ -4,12 +4,13 @@ import (
"bytes" "bytes"
"errors" "errors"
"fmt" "fmt"
"github.com/chrislusf/weed-fs/go/glog"
"io" "io"
"os" "os"
"path" "path"
"sync" "sync"
"time" "time"
"github.com/chrislusf/weed-fs/go/glog"
) )
type Volume struct { type Volume struct {

3
go/storage/volume_super_block.go

@ -1,9 +1,10 @@
package storage package storage
import ( import (
"github.com/chrislusf/weed-fs/go/glog"
"fmt" "fmt"
"os" "os"
"github.com/chrislusf/weed-fs/go/glog"
) )
const ( const (

3
go/storage/volume_vacuum.go

@ -1,10 +1,11 @@
package storage package storage
import ( import (
"github.com/chrislusf/weed-fs/go/glog"
"fmt" "fmt"
"os" "os"
"time" "time"
"github.com/chrislusf/weed-fs/go/glog"
) )
func (v *Volume) garbageLevel() float64 { func (v *Volume) garbageLevel() float64 {

2
go/storage/volume_version.go

@ -1,7 +1,5 @@
package storage package storage
import ()
type Version uint8 type Version uint8
const ( const (

3
go/tools/read_index.go

@ -1,11 +1,12 @@
package main package main
import ( import (
"github.com/chrislusf/weed-fs/go/storage"
"flag" "flag"
"fmt" "fmt"
"log" "log"
"os" "os"
"github.com/chrislusf/weed-fs/go/storage"
) )
var ( var (

5
go/topology/allocate_volume.go

@ -1,11 +1,12 @@
package topology package topology
import ( import (
"github.com/chrislusf/weed-fs/go/storage"
"github.com/chrislusf/weed-fs/go/util"
"encoding/json" "encoding/json"
"errors" "errors"
"net/url" "net/url"
"github.com/chrislusf/weed-fs/go/storage"
"github.com/chrislusf/weed-fs/go/util"
) )
type AllocateVolumeResult struct { type AllocateVolumeResult struct {

2
go/topology/data_center.go

@ -1,7 +1,5 @@
package topology package topology
import ()
type DataCenter struct { type DataCenter struct {
NodeImpl NodeImpl
} }

3
go/topology/data_node.go

@ -1,9 +1,10 @@
package topology package topology
import ( import (
"strconv"
"github.com/chrislusf/weed-fs/go/glog" "github.com/chrislusf/weed-fs/go/glog"
"github.com/chrislusf/weed-fs/go/storage" "github.com/chrislusf/weed-fs/go/storage"
"strconv"
) )
type DataNode struct { type DataNode struct {

5
go/topology/node.go

@ -1,11 +1,12 @@
package topology package topology
import ( import (
"github.com/chrislusf/weed-fs/go/glog"
"github.com/chrislusf/weed-fs/go/storage"
"errors" "errors"
"math/rand" "math/rand"
"strings" "strings"
"github.com/chrislusf/weed-fs/go/glog"
"github.com/chrislusf/weed-fs/go/storage"
) )
type NodeId string type NodeId string

5
go/topology/store_replicate.go

@ -2,12 +2,13 @@ package topology
import ( import (
"bytes" "bytes"
"net/http"
"strconv"
"github.com/chrislusf/weed-fs/go/glog" "github.com/chrislusf/weed-fs/go/glog"
"github.com/chrislusf/weed-fs/go/operation" "github.com/chrislusf/weed-fs/go/operation"
"github.com/chrislusf/weed-fs/go/storage" "github.com/chrislusf/weed-fs/go/storage"
"github.com/chrislusf/weed-fs/go/util" "github.com/chrislusf/weed-fs/go/util"
"net/http"
"strconv"
) )
func ReplicatedWrite(masterNode string, s *storage.Store, volumeId storage.VolumeId, needle *storage.Needle, r *http.Request) (size uint32, errorStatus string) { func ReplicatedWrite(masterNode string, s *storage.Store, volumeId storage.VolumeId, needle *storage.Needle, r *http.Request) (size uint32, errorStatus string) {

7
go/topology/topology.go

@ -1,14 +1,15 @@
package topology package topology
import ( import (
"errors"
"io/ioutil"
"math/rand"
"github.com/chrislusf/weed-fs/go/glog" "github.com/chrislusf/weed-fs/go/glog"
"github.com/chrislusf/weed-fs/go/operation" "github.com/chrislusf/weed-fs/go/operation"
"github.com/chrislusf/weed-fs/go/sequence" "github.com/chrislusf/weed-fs/go/sequence"
"github.com/chrislusf/weed-fs/go/storage" "github.com/chrislusf/weed-fs/go/storage"
"errors"
"github.com/goraft/raft" "github.com/goraft/raft"
"io/ioutil"
"math/rand"
) )
type Topology struct { type Topology struct {

5
go/topology/topology_event_handling.go

@ -1,10 +1,11 @@
package topology package topology
import ( import (
"github.com/chrislusf/weed-fs/go/glog"
"github.com/chrislusf/weed-fs/go/storage"
"math/rand" "math/rand"
"time" "time"
"github.com/chrislusf/weed-fs/go/glog"
"github.com/chrislusf/weed-fs/go/storage"
) )
func (t *Topology) StartRefreshWritableVolumes(garbageThreshold string) { func (t *Topology) StartRefreshWritableVolumes(garbageThreshold string) {

2
go/topology/topology_map.go

@ -1,7 +1,5 @@
package topology package topology
import ()
func (t *Topology) ToMap() interface{} { func (t *Topology) ToMap() interface{} {
m := make(map[string]interface{}) m := make(map[string]interface{})
m["Max"] = t.GetMaxVolumeCount() m["Max"] = t.GetMaxVolumeCount()

7
go/topology/topology_vacuum.go

@ -1,13 +1,14 @@
package topology package topology
import ( import (
"github.com/chrislusf/weed-fs/go/glog"
"github.com/chrislusf/weed-fs/go/storage"
"github.com/chrislusf/weed-fs/go/util"
"encoding/json" "encoding/json"
"errors" "errors"
"net/url" "net/url"
"time" "time"
"github.com/chrislusf/weed-fs/go/glog"
"github.com/chrislusf/weed-fs/go/storage"
"github.com/chrislusf/weed-fs/go/util"
) )
func batchVacuumVolumeCheck(vl *VolumeLayout, vid storage.VolumeId, locationlist *VolumeLocationList, garbageThreshold string) bool { func batchVacuumVolumeCheck(vl *VolumeLayout, vid storage.VolumeId, locationlist *VolumeLocationList, garbageThreshold string) bool {

5
go/topology/volume_growth.go

@ -1,11 +1,12 @@
package topology package topology
import ( import (
"github.com/chrislusf/weed-fs/go/glog"
"github.com/chrislusf/weed-fs/go/storage"
"fmt" "fmt"
"math/rand" "math/rand"
"sync" "sync"
"github.com/chrislusf/weed-fs/go/glog"
"github.com/chrislusf/weed-fs/go/storage"
) )
/* /*

5
go/topology/volume_growth_test.go

@ -1,11 +1,12 @@
package topology package topology
import ( import (
"github.com/chrislusf/weed-fs/go/sequence"
"github.com/chrislusf/weed-fs/go/storage"
"encoding/json" "encoding/json"
"fmt" "fmt"
"testing" "testing"
"github.com/chrislusf/weed-fs/go/sequence"
"github.com/chrislusf/weed-fs/go/storage"
) )
var topologyLayout = ` var topologyLayout = `

5
go/topology/volume_layout.go

@ -1,11 +1,12 @@
package topology package topology
import ( import (
"github.com/chrislusf/weed-fs/go/glog"
"github.com/chrislusf/weed-fs/go/storage"
"errors" "errors"
"math/rand" "math/rand"
"sync" "sync"
"github.com/chrislusf/weed-fs/go/glog"
"github.com/chrislusf/weed-fs/go/storage"
) )
// mapping from volume to its locations, inverted from server to volume // mapping from volume to its locations, inverted from server to volume

2
go/topology/volume_location_list.go

@ -1,7 +1,5 @@
package topology package topology
import ()
type VolumeLocationList struct { type VolumeLocationList struct {
list []*DataNode list []*DataNode
} }

3
go/util/config.go

@ -10,9 +10,10 @@ package util
import ( import (
"bytes" "bytes"
"github.com/chrislusf/weed-fs/go/glog"
"encoding/json" "encoding/json"
"os" "os"
"github.com/chrislusf/weed-fs/go/glog"
) )
type Config struct { type Config struct {

2
go/util/constants.go

@ -1,7 +1,5 @@
package util package util
import ()
const ( const (
VERSION = "0.64" VERSION = "0.64"
) )

3
go/util/file_util.go

@ -2,9 +2,10 @@ package util
import ( import (
"bufio" "bufio"
"github.com/chrislusf/weed-fs/go/glog"
"errors" "errors"
"os" "os"
"github.com/chrislusf/weed-fs/go/glog"
) )
func TestFolderWritable(folder string) (err error) { func TestFolderWritable(folder string) (err error) {

3
go/util/net_timeout.go

@ -1,9 +1,10 @@
package util package util
import ( import (
"github.com/chrislusf/weed-fs/go/stats"
"net" "net"
"time" "time"
"github.com/chrislusf/weed-fs/go/stats"
) )
// Listener wraps a net.Listener, and gives a place to store the timeout // Listener wraps a net.Listener, and gives a place to store the timeout

7
go/weed/benchmark.go

@ -2,9 +2,6 @@ package main
import ( import (
"bufio" "bufio"
"github.com/chrislusf/weed-fs/go/glog"
"github.com/chrislusf/weed-fs/go/operation"
"github.com/chrislusf/weed-fs/go/util"
"fmt" "fmt"
"io" "io"
"math" "math"
@ -16,6 +13,10 @@ import (
"strings" "strings"
"sync" "sync"
"time" "time"
"github.com/chrislusf/weed-fs/go/glog"
"github.com/chrislusf/weed-fs/go/operation"
"github.com/chrislusf/weed-fs/go/util"
) )
type BenchmarkOptions struct { type BenchmarkOptions struct {

5
go/weed/download.go

@ -1,14 +1,15 @@
package main package main
import ( import (
"github.com/chrislusf/weed-fs/go/operation"
"github.com/chrislusf/weed-fs/go/util"
"fmt" "fmt"
"io" "io"
"io/ioutil" "io/ioutil"
"os" "os"
"path" "path"
"strings" "strings"
"github.com/chrislusf/weed-fs/go/operation"
"github.com/chrislusf/weed-fs/go/util"
) )
var ( var (

5
go/weed/export.go

@ -4,14 +4,15 @@ import (
"archive/tar" "archive/tar"
"bytes" "bytes"
"fmt" "fmt"
"github.com/chrislusf/weed-fs/go/glog"
"github.com/chrislusf/weed-fs/go/storage"
"os" "os"
"path" "path"
"strconv" "strconv"
"strings" "strings"
"text/template" "text/template"
"time" "time"
"github.com/chrislusf/weed-fs/go/glog"
"github.com/chrislusf/weed-fs/go/storage"
) )
func init() { func init() {

7
go/weed/filer.go

@ -1,13 +1,14 @@
package main package main
import ( import (
"github.com/chrislusf/weed-fs/go/glog"
"github.com/chrislusf/weed-fs/go/util"
"github.com/chrislusf/weed-fs/go/weed/weed_server"
"net/http" "net/http"
"os" "os"
"strconv" "strconv"
"time" "time"
"github.com/chrislusf/weed-fs/go/glog"
"github.com/chrislusf/weed-fs/go/util"
"github.com/chrislusf/weed-fs/go/weed/weed_server"
) )
var ( var (

5
go/weed/fix.go

@ -1,11 +1,12 @@
package main package main
import ( import (
"github.com/chrislusf/weed-fs/go/glog"
"github.com/chrislusf/weed-fs/go/storage"
"os" "os"
"path" "path"
"strconv" "strconv"
"github.com/chrislusf/weed-fs/go/glog"
"github.com/chrislusf/weed-fs/go/storage"
) )
func init() { func init() {

9
go/weed/master.go

@ -1,16 +1,17 @@
package main package main
import ( import (
"github.com/chrislusf/weed-fs/go/glog"
"github.com/chrislusf/weed-fs/go/util"
"github.com/chrislusf/weed-fs/go/weed/weed_server"
"github.com/gorilla/mux"
"net/http" "net/http"
"os" "os"
"runtime" "runtime"
"strconv" "strconv"
"strings" "strings"
"time" "time"
"github.com/chrislusf/weed-fs/go/glog"
"github.com/chrislusf/weed-fs/go/util"
"github.com/chrislusf/weed-fs/go/weed/weed_server"
"github.com/gorilla/mux"
) )
func init() { func init() {

2
go/weed/mount.go

@ -1,7 +1,5 @@
package main package main
import ()
type MountOptions struct { type MountOptions struct {
filer *string filer *string
dir *string dir *string

7
go/weed/mount_std.go

@ -3,15 +3,16 @@
package main package main
import ( import (
"fmt"
"os"
"runtime"
"bazil.org/fuse" "bazil.org/fuse"
"bazil.org/fuse/fs" "bazil.org/fuse/fs"
"github.com/chrislusf/weed-fs/go/filer" "github.com/chrislusf/weed-fs/go/filer"
"github.com/chrislusf/weed-fs/go/glog" "github.com/chrislusf/weed-fs/go/glog"
"github.com/chrislusf/weed-fs/go/storage" "github.com/chrislusf/weed-fs/go/storage"
"github.com/chrislusf/weed-fs/go/util" "github.com/chrislusf/weed-fs/go/util"
"fmt"
"os"
"runtime"
) )
func runMount(cmd *Command, args []string) bool { func runMount(cmd *Command, args []string) bool {

9
go/weed/server.go

@ -1,10 +1,6 @@
package main package main
import ( import (
"github.com/chrislusf/weed-fs/go/glog"
"github.com/chrislusf/weed-fs/go/util"
"github.com/chrislusf/weed-fs/go/weed/weed_server"
"github.com/gorilla/mux"
"net/http" "net/http"
"os" "os"
"runtime" "runtime"
@ -13,6 +9,11 @@ import (
"strings" "strings"
"sync" "sync"
"time" "time"
"github.com/chrislusf/weed-fs/go/glog"
"github.com/chrislusf/weed-fs/go/util"
"github.com/chrislusf/weed-fs/go/weed/weed_server"
"github.com/gorilla/mux"
) )
type ServerOptions struct { type ServerOptions struct {

3
go/weed/shell.go

@ -2,9 +2,10 @@ package main
import ( import (
"bufio" "bufio"
"github.com/chrislusf/weed-fs/go/glog"
"fmt" "fmt"
"os" "os"
"github.com/chrislusf/weed-fs/go/glog"
) )
func init() { func init() {

2
go/weed/signal_handling_notsupported.go

@ -2,7 +2,5 @@
package main package main
import ()
func OnInterrupt(fn func()) { func OnInterrupt(fn func()) {
} }

3
go/weed/upload.go

@ -1,11 +1,12 @@
package main package main
import ( import (
"github.com/chrislusf/weed-fs/go/operation"
"encoding/json" "encoding/json"
"fmt" "fmt"
"os" "os"
"path/filepath" "path/filepath"
"github.com/chrislusf/weed-fs/go/operation"
) )
var ( var (

3
go/weed/version.go

@ -1,9 +1,10 @@
package main package main
import ( import (
"github.com/chrislusf/weed-fs/go/util"
"fmt" "fmt"
"runtime" "runtime"
"github.com/chrislusf/weed-fs/go/util"
) )
var cmdVersion = &Command{ var cmdVersion = &Command{

7
go/weed/volume.go

@ -1,15 +1,16 @@
package main package main
import ( import (
"github.com/chrislusf/weed-fs/go/glog"
"github.com/chrislusf/weed-fs/go/util"
"github.com/chrislusf/weed-fs/go/weed/weed_server"
"net/http" "net/http"
"os" "os"
"runtime" "runtime"
"strconv" "strconv"
"strings" "strings"
"time" "time"
"github.com/chrislusf/weed-fs/go/glog"
"github.com/chrislusf/weed-fs/go/util"
"github.com/chrislusf/weed-fs/go/weed/weed_server"
) )
func init() { func init() {

3
go/weed/volume_test.go

@ -1,10 +1,11 @@
package main package main
import ( import (
"github.com/chrislusf/weed-fs/go/glog"
"net/http" "net/http"
"testing" "testing"
"time" "time"
"github.com/chrislusf/weed-fs/go/glog"
) )
func TestXYZ(t *testing.T) { func TestXYZ(t *testing.T) {

3
go/weed/weed.go

@ -1,7 +1,6 @@
package main package main
import ( import (
"github.com/chrislusf/weed-fs/go/glog"
"flag" "flag"
"fmt" "fmt"
"io" "io"
@ -13,6 +12,8 @@ import (
"time" "time"
"unicode" "unicode"
"unicode/utf8" "unicode/utf8"
"github.com/chrislusf/weed-fs/go/glog"
) )
var IsDebug *bool var IsDebug *bool

11
go/weed/weed_server/common.go

@ -2,11 +2,6 @@ package weed_server
import ( import (
"bytes" "bytes"
"github.com/chrislusf/weed-fs/go/glog"
"github.com/chrislusf/weed-fs/go/operation"
"github.com/chrislusf/weed-fs/go/stats"
"github.com/chrislusf/weed-fs/go/storage"
"github.com/chrislusf/weed-fs/go/util"
"encoding/json" "encoding/json"
"fmt" "fmt"
"net" "net"
@ -14,6 +9,12 @@ import (
"path/filepath" "path/filepath"
"strconv" "strconv"
"strings" "strings"
"github.com/chrislusf/weed-fs/go/glog"
"github.com/chrislusf/weed-fs/go/operation"
"github.com/chrislusf/weed-fs/go/stats"
"github.com/chrislusf/weed-fs/go/storage"
"github.com/chrislusf/weed-fs/go/util"
) )
var serverStats *stats.ServerStats var serverStats *stats.ServerStats

5
go/weed/weed_server/filer_server.go

@ -1,10 +1,11 @@
package weed_server package weed_server
import ( import (
"github.com/chrislusf/weed-fs/go/filer"
"github.com/chrislusf/weed-fs/go/glog"
"net/http" "net/http"
"strconv" "strconv"
"github.com/chrislusf/weed-fs/go/filer"
"github.com/chrislusf/weed-fs/go/glog"
) )
type FilerServer struct { type FilerServer struct {

9
go/weed/weed_server/filer_server_handlers.go

@ -1,12 +1,8 @@
package weed_server package weed_server
import ( import (
"github.com/chrislusf/weed-fs/go/glog"
"github.com/chrislusf/weed-fs/go/operation"
"github.com/chrislusf/weed-fs/go/util"
"encoding/json" "encoding/json"
"errors" "errors"
"github.com/syndtr/goleveldb/leveldb"
"io" "io"
"io/ioutil" "io/ioutil"
"math/rand" "math/rand"
@ -14,6 +10,11 @@ import (
"net/url" "net/url"
"strconv" "strconv"
"strings" "strings"
"github.com/chrislusf/weed-fs/go/glog"
"github.com/chrislusf/weed-fs/go/operation"
"github.com/chrislusf/weed-fs/go/util"
"github.com/syndtr/goleveldb/leveldb"
) )
func (fs *FilerServer) filerHandler(w http.ResponseWriter, r *http.Request) { func (fs *FilerServer) filerHandler(w http.ResponseWriter, r *http.Request) {

3
go/weed/weed_server/filer_server_handlers_admin.go

@ -1,8 +1,9 @@
package weed_server package weed_server
import ( import (
"github.com/chrislusf/weed-fs/go/glog"
"net/http" "net/http"
"github.com/chrislusf/weed-fs/go/glog"
) )
/* /*

9
go/weed/weed_server/master_server.go

@ -1,16 +1,17 @@
package weed_server package weed_server
import ( import (
"net/http"
"net/http/httputil"
"net/url"
"sync"
"github.com/chrislusf/weed-fs/go/glog" "github.com/chrislusf/weed-fs/go/glog"
"github.com/chrislusf/weed-fs/go/sequence" "github.com/chrislusf/weed-fs/go/sequence"
"github.com/chrislusf/weed-fs/go/topology" "github.com/chrislusf/weed-fs/go/topology"
"github.com/chrislusf/weed-fs/go/util" "github.com/chrislusf/weed-fs/go/util"
"github.com/goraft/raft" "github.com/goraft/raft"
"github.com/gorilla/mux" "github.com/gorilla/mux"
"net/http"
"net/http/httputil"
"net/url"
"sync"
) )
type MasterServer struct { type MasterServer struct {

7
go/weed/weed_server/master_server_handlers.go

@ -1,12 +1,13 @@
package weed_server package weed_server
import ( import (
"github.com/chrislusf/weed-fs/go/operation"
"github.com/chrislusf/weed-fs/go/stats"
"github.com/chrislusf/weed-fs/go/storage"
"net/http" "net/http"
"strconv" "strconv"
"strings" "strings"
"github.com/chrislusf/weed-fs/go/operation"
"github.com/chrislusf/weed-fs/go/stats"
"github.com/chrislusf/weed-fs/go/storage"
) )
func (ms *MasterServer) lookupVolumeId(vids []string, collection string) (volumeLocations map[string]operation.LookupResult) { func (ms *MasterServer) lookupVolumeId(vids []string, collection string) (volumeLocations map[string]operation.LookupResult) {

13
go/weed/weed_server/master_server_handlers_admin.go

@ -1,18 +1,19 @@
package weed_server package weed_server
import ( import (
proto "code.google.com/p/goprotobuf/proto"
"github.com/chrislusf/weed-fs/go/glog"
"github.com/chrislusf/weed-fs/go/operation"
"github.com/chrislusf/weed-fs/go/storage"
"github.com/chrislusf/weed-fs/go/topology"
"github.com/chrislusf/weed-fs/go/util"
"encoding/json" "encoding/json"
"errors" "errors"
"io/ioutil" "io/ioutil"
"net/http" "net/http"
"strconv" "strconv"
"strings" "strings"
proto "code.google.com/p/goprotobuf/proto"
"github.com/chrislusf/weed-fs/go/glog"
"github.com/chrislusf/weed-fs/go/operation"
"github.com/chrislusf/weed-fs/go/storage"
"github.com/chrislusf/weed-fs/go/topology"
"github.com/chrislusf/weed-fs/go/util"
) )
func (ms *MasterServer) collectionDeleteHandler(w http.ResponseWriter, r *http.Request) { func (ms *MasterServer) collectionDeleteHandler(w http.ResponseWriter, r *http.Request) {

9
go/weed/weed_server/raft_server.go

@ -2,19 +2,20 @@ package weed_server
import ( import (
"bytes" "bytes"
"github.com/chrislusf/weed-fs/go/glog"
"github.com/chrislusf/weed-fs/go/topology"
"encoding/json" "encoding/json"
"errors" "errors"
"fmt" "fmt"
"github.com/goraft/raft"
"github.com/gorilla/mux"
"io/ioutil" "io/ioutil"
"math/rand" "math/rand"
"net/http" "net/http"
"net/url" "net/url"
"strings" "strings"
"time" "time"
"github.com/chrislusf/weed-fs/go/glog"
"github.com/chrislusf/weed-fs/go/topology"
"github.com/goraft/raft"
"github.com/gorilla/mux"
) )
type RaftServer struct { type RaftServer struct {

7
go/weed/weed_server/raft_server_handlers.go

@ -1,13 +1,14 @@
package weed_server package weed_server
import ( import (
"github.com/chrislusf/weed-fs/go/glog"
"github.com/chrislusf/weed-fs/go/operation"
"encoding/json" "encoding/json"
"github.com/goraft/raft"
"io/ioutil" "io/ioutil"
"net/http" "net/http"
"strings" "strings"
"github.com/chrislusf/weed-fs/go/glog"
"github.com/chrislusf/weed-fs/go/operation"
"github.com/goraft/raft"
) )
// Handles incoming RAFT joins. // Handles incoming RAFT joins.

5
go/weed/weed_server/volume_server.go

@ -1,12 +1,13 @@
package weed_server package weed_server
import ( import (
"github.com/chrislusf/weed-fs/go/glog"
"github.com/chrislusf/weed-fs/go/storage"
"math/rand" "math/rand"
"net/http" "net/http"
"strconv" "strconv"
"time" "time"
"github.com/chrislusf/weed-fs/go/glog"
"github.com/chrislusf/weed-fs/go/storage"
) )
type VolumeServer struct { type VolumeServer struct {

13
go/weed/weed_server/volume_server_handlers.go

@ -1,12 +1,6 @@
package weed_server package weed_server
import ( import (
"github.com/chrislusf/weed-fs/go/glog"
"github.com/chrislusf/weed-fs/go/images"
"github.com/chrislusf/weed-fs/go/operation"
"github.com/chrislusf/weed-fs/go/stats"
"github.com/chrislusf/weed-fs/go/storage"
"github.com/chrislusf/weed-fs/go/topology"
"io" "io"
"mime" "mime"
"mime/multipart" "mime/multipart"
@ -14,6 +8,13 @@ import (
"strconv" "strconv"
"strings" "strings"
"time" "time"
"github.com/chrislusf/weed-fs/go/glog"
"github.com/chrislusf/weed-fs/go/images"
"github.com/chrislusf/weed-fs/go/operation"
"github.com/chrislusf/weed-fs/go/stats"
"github.com/chrislusf/weed-fs/go/storage"
"github.com/chrislusf/weed-fs/go/topology"
) )
var fileNameEscaper = strings.NewReplacer("\\", "\\\\", "\"", "\\\"") var fileNameEscaper = strings.NewReplacer("\\", "\\\\", "\"", "\\\"")

5
go/weed/weed_server/volume_server_handlers_admin.go

@ -1,11 +1,12 @@
package weed_server package weed_server
import ( import (
"net/http"
"path/filepath"
"github.com/chrislusf/weed-fs/go/glog" "github.com/chrislusf/weed-fs/go/glog"
"github.com/chrislusf/weed-fs/go/stats" "github.com/chrislusf/weed-fs/go/stats"
"github.com/chrislusf/weed-fs/go/util" "github.com/chrislusf/weed-fs/go/util"
"net/http"
"path/filepath"
) )
func (vs *VolumeServer) statusHandler(w http.ResponseWriter, r *http.Request) { func (vs *VolumeServer) statusHandler(w http.ResponseWriter, r *http.Request) {

3
go/weed/weed_server/volume_server_handlers_vacuum.go

@ -1,8 +1,9 @@
package weed_server package weed_server
import ( import (
"github.com/chrislusf/weed-fs/go/glog"
"net/http" "net/http"
"github.com/chrislusf/weed-fs/go/glog"
) )
func (vs *VolumeServer) vacuumVolumeCheckHandler(w http.ResponseWriter, r *http.Request) { func (vs *VolumeServer) vacuumVolumeCheckHandler(w http.ResponseWriter, r *http.Request) {

Loading…
Cancel
Save