This commit is contained in:
Chris Lu
2018-07-21 17:39:10 -07:00
parent dc8dd8b486
commit 7e2031b18f
43 changed files with 109 additions and 109 deletions

View File

@@ -8,16 +8,16 @@ import (
"path/filepath" "path/filepath"
"strings" "strings"
"github.com/chrislusf/seaweedfs/weed/operation"
"github.com/chrislusf/seaweedfs/weed/security"
"path"
"net/http"
"github.com/chrislusf/seaweedfs/weed/pb/filer_pb"
"strconv"
"io"
"time"
"context" "context"
"github.com/chrislusf/seaweedfs/weed/operation"
"github.com/chrislusf/seaweedfs/weed/pb/filer_pb"
"github.com/chrislusf/seaweedfs/weed/security"
"github.com/chrislusf/seaweedfs/weed/util" "github.com/chrislusf/seaweedfs/weed/util"
"io"
"net/http"
"path"
"strconv"
"time"
) )
var ( var (

View File

@@ -11,8 +11,8 @@ import (
"github.com/chrislusf/seaweedfs/weed/filesys" "github.com/chrislusf/seaweedfs/weed/filesys"
"github.com/chrislusf/seaweedfs/weed/glog" "github.com/chrislusf/seaweedfs/weed/glog"
"github.com/chrislusf/seaweedfs/weed/util" "github.com/chrislusf/seaweedfs/weed/util"
"strings"
"strconv" "strconv"
"strings"
) )
func runMount(cmd *Command, args []string) bool { func runMount(cmd *Command, args []string) bool {

View File

@@ -4,11 +4,11 @@ import (
"net/http" "net/http"
"time" "time"
"fmt"
"github.com/chrislusf/seaweedfs/weed/glog" "github.com/chrislusf/seaweedfs/weed/glog"
"github.com/chrislusf/seaweedfs/weed/s3api"
"github.com/chrislusf/seaweedfs/weed/util" "github.com/chrislusf/seaweedfs/weed/util"
"github.com/gorilla/mux" "github.com/gorilla/mux"
"fmt"
"github.com/chrislusf/seaweedfs/weed/s3api"
) )
var ( var (

View File

@@ -77,7 +77,7 @@ func (store *AbstractSqlStore) FindEntry(fullpath filer2.FullPath) (*filer2.Entr
return entry, nil return entry, nil
} }
func (store *AbstractSqlStore) DeleteEntry(fullpath filer2.FullPath) (error) { func (store *AbstractSqlStore) DeleteEntry(fullpath filer2.FullPath) error {
dir, name := fullpath.DirAndName() dir, name := fullpath.DirAndName()

View File

@@ -1,12 +1,12 @@
package filer2 package filer2
import ( import (
"fmt"
"context" "context"
"fmt"
"time" "time"
"github.com/chrislusf/seaweedfs/weed/pb/master_pb"
"github.com/chrislusf/seaweedfs/weed/glog" "github.com/chrislusf/seaweedfs/weed/glog"
"github.com/chrislusf/seaweedfs/weed/pb/master_pb"
"github.com/chrislusf/seaweedfs/weed/util" "github.com/chrislusf/seaweedfs/weed/util"
) )

View File

@@ -9,9 +9,9 @@ import (
"bazil.org/fuse" "bazil.org/fuse"
"bazil.org/fuse/fs" "bazil.org/fuse/fs"
"github.com/chrislusf/seaweedfs/weed/filer2"
"github.com/chrislusf/seaweedfs/weed/glog" "github.com/chrislusf/seaweedfs/weed/glog"
"github.com/chrislusf/seaweedfs/weed/pb/filer_pb" "github.com/chrislusf/seaweedfs/weed/pb/filer_pb"
"github.com/chrislusf/seaweedfs/weed/filer2"
) )
type Dir struct { type Dir struct {

View File

@@ -1,9 +1,9 @@
package filesys package filesys
import ( import (
"context"
"bazil.org/fuse" "bazil.org/fuse"
"bazil.org/fuse/fs" "bazil.org/fuse/fs"
"context"
"github.com/chrislusf/seaweedfs/weed/glog" "github.com/chrislusf/seaweedfs/weed/glog"
"github.com/chrislusf/seaweedfs/weed/pb/filer_pb" "github.com/chrislusf/seaweedfs/weed/pb/filer_pb"
"path/filepath" "path/filepath"

View File

@@ -1,14 +1,14 @@
package filesys package filesys
import ( import (
"fmt"
"bytes" "bytes"
"time"
"context" "context"
"fmt"
"time"
"github.com/chrislusf/seaweedfs/weed/pb/filer_pb"
"github.com/chrislusf/seaweedfs/weed/operation"
"github.com/chrislusf/seaweedfs/weed/glog" "github.com/chrislusf/seaweedfs/weed/glog"
"github.com/chrislusf/seaweedfs/weed/operation"
"github.com/chrislusf/seaweedfs/weed/pb/filer_pb"
) )
type ContinuousDirtyPages struct { type ContinuousDirtyPages struct {

View File

@@ -9,9 +9,9 @@ import (
"github.com/chrislusf/seaweedfs/weed/glog" "github.com/chrislusf/seaweedfs/weed/glog"
"github.com/chrislusf/seaweedfs/weed/pb/filer_pb" "github.com/chrislusf/seaweedfs/weed/pb/filer_pb"
"github.com/chrislusf/seaweedfs/weed/util" "github.com/chrislusf/seaweedfs/weed/util"
"net/http"
"strings" "strings"
"sync" "sync"
"net/http"
) )
type FileHandle struct { type FileHandle struct {

View File

@@ -1,15 +1,15 @@
package filesys package filesys
import ( import (
"bazil.org/fuse"
"bazil.org/fuse/fs" "bazil.org/fuse/fs"
"fmt" "fmt"
"github.com/chrislusf/seaweedfs/weed/pb/filer_pb"
"github.com/karlseguin/ccache"
"sync"
"bazil.org/fuse"
"github.com/chrislusf/seaweedfs/weed/glog" "github.com/chrislusf/seaweedfs/weed/glog"
"github.com/chrislusf/seaweedfs/weed/pb/filer_pb"
"github.com/chrislusf/seaweedfs/weed/util" "github.com/chrislusf/seaweedfs/weed/util"
"github.com/karlseguin/ccache"
"strings" "strings"
"sync"
) )
type WFS struct { type WFS struct {

View File

@@ -6,8 +6,8 @@ import (
"net/url" "net/url"
"github.com/chrislusf/seaweedfs/weed/glog" "github.com/chrislusf/seaweedfs/weed/glog"
"github.com/chrislusf/seaweedfs/weed/util"
. "github.com/chrislusf/seaweedfs/weed/storage/types" . "github.com/chrislusf/seaweedfs/weed/storage/types"
"github.com/chrislusf/seaweedfs/weed/util"
) )
type SyncVolumeResponse struct { type SyncVolumeResponse struct {

View File

@@ -1,14 +1,14 @@
package s3api package s3api
import ( import (
"net/http"
"github.com/chrislusf/seaweedfs/weed/pb/filer_pb"
"github.com/chrislusf/seaweedfs/weed/glog"
"time"
"context" "context"
"fmt" "fmt"
"github.com/chrislusf/seaweedfs/weed/glog"
"github.com/chrislusf/seaweedfs/weed/pb/filer_pb"
"github.com/gorilla/mux" "github.com/gorilla/mux"
"net/http"
"os" "os"
"time"
) )
var ( var (

View File

@@ -1,17 +1,17 @@
package s3api package s3api
import ( import (
"net/http" "bytes"
"net/url"
"fmt"
"time"
"github.com/gorilla/mux"
"context" "context"
"encoding/base64"
"encoding/xml"
"fmt"
"github.com/chrislusf/seaweedfs/weed/pb/filer_pb" "github.com/chrislusf/seaweedfs/weed/pb/filer_pb"
"github.com/chrislusf/seaweedfs/weed/util" "github.com/chrislusf/seaweedfs/weed/util"
"bytes" "github.com/gorilla/mux"
"encoding/xml" "net/http"
"encoding/base64" "net/url"
"time"
) )
type mimeType string type mimeType string

View File

@@ -1,12 +1,12 @@
package s3api package s3api
import ( import (
"net/http" "encoding/json"
"github.com/chrislusf/seaweedfs/weed/glog"
"fmt" "fmt"
"github.com/chrislusf/seaweedfs/weed/glog"
"github.com/gorilla/mux" "github.com/gorilla/mux"
"io/ioutil" "io/ioutil"
"encoding/json" "net/http"
) )
var ( var (

View File

@@ -11,8 +11,8 @@ import (
"github.com/chrislusf/seaweedfs/weed/glog" "github.com/chrislusf/seaweedfs/weed/glog"
"github.com/chrislusf/seaweedfs/weed/operation" "github.com/chrislusf/seaweedfs/weed/operation"
"github.com/chrislusf/seaweedfs/weed/pb/filer_pb" "github.com/chrislusf/seaweedfs/weed/pb/filer_pb"
"strconv"
"github.com/chrislusf/seaweedfs/weed/util" "github.com/chrislusf/seaweedfs/weed/util"
"strconv"
) )
func (fs *FilerServer) LookupDirectoryEntry(ctx context.Context, req *filer_pb.LookupDirectoryEntryRequest) (*filer_pb.LookupDirectoryEntryResponse, error) { func (fs *FilerServer) LookupDirectoryEntry(ctx context.Context, req *filer_pb.LookupDirectoryEntryRequest) (*filer_pb.LookupDirectoryEntryResponse, error) {

View File

@@ -1,7 +1,6 @@
package weed_server package weed_server
import ( import (
"net/http"
"github.com/chrislusf/seaweedfs/weed/filer2" "github.com/chrislusf/seaweedfs/weed/filer2"
_ "github.com/chrislusf/seaweedfs/weed/filer2/cassandra" _ "github.com/chrislusf/seaweedfs/weed/filer2/cassandra"
_ "github.com/chrislusf/seaweedfs/weed/filer2/leveldb" _ "github.com/chrislusf/seaweedfs/weed/filer2/leveldb"
@@ -9,8 +8,9 @@ import (
_ "github.com/chrislusf/seaweedfs/weed/filer2/mysql" _ "github.com/chrislusf/seaweedfs/weed/filer2/mysql"
_ "github.com/chrislusf/seaweedfs/weed/filer2/postgres" _ "github.com/chrislusf/seaweedfs/weed/filer2/postgres"
_ "github.com/chrislusf/seaweedfs/weed/filer2/redis" _ "github.com/chrislusf/seaweedfs/weed/filer2/redis"
"github.com/chrislusf/seaweedfs/weed/security"
"github.com/chrislusf/seaweedfs/weed/glog" "github.com/chrislusf/seaweedfs/weed/glog"
"github.com/chrislusf/seaweedfs/weed/security"
"net/http"
) )
type FilerOption struct { type FilerOption struct {

View File

@@ -10,10 +10,10 @@ import (
"github.com/chrislusf/seaweedfs/weed/glog" "github.com/chrislusf/seaweedfs/weed/glog"
"github.com/chrislusf/seaweedfs/weed/operation" "github.com/chrislusf/seaweedfs/weed/operation"
"github.com/chrislusf/seaweedfs/weed/util" "github.com/chrislusf/seaweedfs/weed/util"
"strconv"
"mime/multipart"
"mime" "mime"
"mime/multipart"
"path" "path"
"strconv"
) )
func (fs *FilerServer) GetOrHeadHandler(w http.ResponseWriter, r *http.Request, isGetMethod bool) { func (fs *FilerServer) GetOrHeadHandler(w http.ResponseWriter, r *http.Request, isGetMethod bool) {

View File

@@ -1,8 +1,8 @@
package weed_server package weed_server
import ( import (
"net/http"
"github.com/chrislusf/seaweedfs/weed/operation" "github.com/chrislusf/seaweedfs/weed/operation"
"net/http"
) )
func (s *RaftServer) HandleFunc(pattern string, handler func(http.ResponseWriter, *http.Request)) { func (s *RaftServer) HandleFunc(pattern string, handler func(http.ResponseWriter, *http.Request)) {

View File

@@ -7,8 +7,8 @@ import (
"github.com/chrislusf/seaweedfs/weed/glog" "github.com/chrislusf/seaweedfs/weed/glog"
"github.com/chrislusf/seaweedfs/weed/pb/master_pb" "github.com/chrislusf/seaweedfs/weed/pb/master_pb"
"github.com/chrislusf/seaweedfs/weed/security" "github.com/chrislusf/seaweedfs/weed/security"
"golang.org/x/net/context"
"github.com/chrislusf/seaweedfs/weed/util" "github.com/chrislusf/seaweedfs/weed/util"
"golang.org/x/net/context"
) )
func (vs *VolumeServer) GetMaster() string { func (vs *VolumeServer) GetMaster() string {

View File

@@ -1,10 +1,10 @@
package weed_server package weed_server
import ( import (
"net/http"
"github.com/chrislusf/seaweedfs/weed/glog" "github.com/chrislusf/seaweedfs/weed/glog"
"github.com/chrislusf/seaweedfs/weed/security" "github.com/chrislusf/seaweedfs/weed/security"
"github.com/chrislusf/seaweedfs/weed/storage" "github.com/chrislusf/seaweedfs/weed/storage"
"net/http"
) )
type VolumeServer struct { type VolumeServer struct {

View File

@@ -6,8 +6,8 @@ import (
"github.com/chrislusf/seaweedfs/weed/glog" "github.com/chrislusf/seaweedfs/weed/glog"
"github.com/chrislusf/seaweedfs/weed/storage" "github.com/chrislusf/seaweedfs/weed/storage"
"github.com/chrislusf/seaweedfs/weed/util"
"github.com/chrislusf/seaweedfs/weed/storage/types" "github.com/chrislusf/seaweedfs/weed/storage/types"
"github.com/chrislusf/seaweedfs/weed/util"
) )
func (vs *VolumeServer) getVolumeSyncStatusHandler(w http.ResponseWriter, r *http.Request) { func (vs *VolumeServer) getVolumeSyncStatusHandler(w http.ResponseWriter, r *http.Request) {

View File

@@ -1,8 +1,8 @@
package needle package needle
import ( import (
"github.com/google/btree"
. "github.com/chrislusf/seaweedfs/weed/storage/types" . "github.com/chrislusf/seaweedfs/weed/storage/types"
"github.com/google/btree"
) )
//This map assumes mostly inserting increasing keys //This map assumes mostly inserting increasing keys

View File

@@ -1,8 +1,8 @@
package needle package needle
import ( import (
"sync"
. "github.com/chrislusf/seaweedfs/weed/storage/types" . "github.com/chrislusf/seaweedfs/weed/storage/types"
"sync"
) )
type CompactSection struct { type CompactSection struct {

View File

@@ -6,8 +6,8 @@ import (
"testing" "testing"
"github.com/chrislusf/seaweedfs/weed/glog" "github.com/chrislusf/seaweedfs/weed/glog"
"github.com/chrislusf/seaweedfs/weed/util"
. "github.com/chrislusf/seaweedfs/weed/storage/types" . "github.com/chrislusf/seaweedfs/weed/storage/types"
"github.com/chrislusf/seaweedfs/weed/util"
) )
func TestMemoryUsage(t *testing.T) { func TestMemoryUsage(t *testing.T) {

View File

@@ -1,8 +1,8 @@
package needle package needle
import ( import (
"testing"
. "github.com/chrislusf/seaweedfs/weed/storage/types" . "github.com/chrislusf/seaweedfs/weed/storage/types"
"testing"
) )
func TestIssue52(t *testing.T) { func TestIssue52(t *testing.T) {

View File

@@ -1,8 +1,8 @@
package needle package needle
import ( import (
"github.com/google/btree"
. "github.com/chrislusf/seaweedfs/weed/storage/types" . "github.com/chrislusf/seaweedfs/weed/storage/types"
"github.com/google/btree"
) )
const ( const (

View File

@@ -6,11 +6,11 @@ import (
"github.com/boltdb/bolt" "github.com/boltdb/bolt"
"errors"
"github.com/chrislusf/seaweedfs/weed/glog" "github.com/chrislusf/seaweedfs/weed/glog"
"github.com/chrislusf/seaweedfs/weed/storage/needle" "github.com/chrislusf/seaweedfs/weed/storage/needle"
. "github.com/chrislusf/seaweedfs/weed/storage/types" . "github.com/chrislusf/seaweedfs/weed/storage/types"
"github.com/chrislusf/seaweedfs/weed/util" "github.com/chrislusf/seaweedfs/weed/util"
"errors"
) )
type BoltDbNeedleMap struct { type BoltDbNeedleMap struct {

View File

@@ -2,10 +2,10 @@ package storage
import ( import (
"fmt" "fmt"
"os"
"github.com/willf/bloom"
"github.com/chrislusf/seaweedfs/weed/glog" "github.com/chrislusf/seaweedfs/weed/glog"
. "github.com/chrislusf/seaweedfs/weed/storage/types" . "github.com/chrislusf/seaweedfs/weed/storage/types"
"github.com/willf/bloom"
"os"
) )
type mapMetric struct { type mapMetric struct {

View File

@@ -1,11 +1,11 @@
package storage package storage
import ( import (
"testing"
"io/ioutil"
"math/rand"
"github.com/chrislusf/seaweedfs/weed/glog" "github.com/chrislusf/seaweedfs/weed/glog"
. "github.com/chrislusf/seaweedfs/weed/storage/types" . "github.com/chrislusf/seaweedfs/weed/storage/types"
"io/ioutil"
"math/rand"
"testing"
) )
func TestFastLoadingNeedleMapMetrics(t *testing.T) { func TestFastLoadingNeedleMapMetrics(t *testing.T) {

View File

@@ -1,12 +1,12 @@
package storage package storage
import ( import (
"mime"
"github.com/chrislusf/seaweedfs/weed/operation"
"github.com/chrislusf/seaweedfs/weed/glog" "github.com/chrislusf/seaweedfs/weed/glog"
"github.com/chrislusf/seaweedfs/weed/operation"
"io/ioutil"
"mime"
"net/http" "net/http"
"path" "path"
"io/ioutil"
"strings" "strings"
) )

View File

@@ -6,8 +6,8 @@ import (
"io" "io"
"os" "os"
. "github.com/chrislusf/seaweedfs/weed/storage/types"
"github.com/chrislusf/seaweedfs/weed/glog" "github.com/chrislusf/seaweedfs/weed/glog"
. "github.com/chrislusf/seaweedfs/weed/storage/types"
"github.com/chrislusf/seaweedfs/weed/util" "github.com/chrislusf/seaweedfs/weed/util"
) )

View File

@@ -1,8 +1,8 @@
package storage package storage
import ( import (
"testing"
"github.com/chrislusf/seaweedfs/weed/storage/types" "github.com/chrislusf/seaweedfs/weed/storage/types"
"testing"
) )
func TestParseKeyHash(t *testing.T) { func TestParseKeyHash(t *testing.T) {

View File

@@ -5,9 +5,9 @@ import (
"strconv" "strconv"
"strings" "strings"
. "github.com/chrislusf/seaweedfs/weed/storage/types"
"github.com/chrislusf/seaweedfs/weed/glog" "github.com/chrislusf/seaweedfs/weed/glog"
"github.com/chrislusf/seaweedfs/weed/pb/master_pb" "github.com/chrislusf/seaweedfs/weed/pb/master_pb"
. "github.com/chrislusf/seaweedfs/weed/storage/types"
) )
const ( const (

View File

@@ -1,9 +1,9 @@
package types package types
import ( import (
"fmt"
"github.com/chrislusf/seaweedfs/weed/util" "github.com/chrislusf/seaweedfs/weed/util"
"strconv" "strconv"
"fmt"
) )
type NeedleId uint64 type NeedleId uint64
@@ -21,11 +21,11 @@ func NeedleIdToUint64(needleId NeedleId) uint64 {
return uint64(needleId) return uint64(needleId)
} }
func Uint64ToNeedleId(needleId uint64) (NeedleId) { func Uint64ToNeedleId(needleId uint64) NeedleId {
return NeedleId(needleId) return NeedleId(needleId)
} }
func BytesToNeedleId(bytes []byte) (NeedleId) { func BytesToNeedleId(bytes []byte) NeedleId {
return NeedleId(util.BytesToUint64(bytes)) return NeedleId(util.BytesToUint64(bytes))
} }

View File

@@ -1,10 +1,10 @@
package types package types
import ( import (
"math"
"github.com/chrislusf/seaweedfs/weed/util"
"strconv"
"fmt" "fmt"
"github.com/chrislusf/seaweedfs/weed/util"
"math"
"strconv"
) )
type Offset uint32 type Offset uint32
@@ -23,11 +23,11 @@ const (
func CookieToBytes(bytes []byte, cookie Cookie) { func CookieToBytes(bytes []byte, cookie Cookie) {
util.Uint32toBytes(bytes, uint32(cookie)) util.Uint32toBytes(bytes, uint32(cookie))
} }
func Uint32ToCookie(cookie uint32) (Cookie) { func Uint32ToCookie(cookie uint32) Cookie {
return Cookie(cookie) return Cookie(cookie)
} }
func BytesToCookie(bytes []byte) (Cookie) { func BytesToCookie(bytes []byte) Cookie {
return Cookie(util.BytesToUint32(bytes[0:4])) return Cookie(util.BytesToUint32(bytes[0:4]))
} }
@@ -43,10 +43,10 @@ func OffsetToBytes(bytes []byte, offset Offset) {
util.Uint32toBytes(bytes, uint32(offset)) util.Uint32toBytes(bytes, uint32(offset))
} }
func Uint32ToOffset(offset uint32) (Offset) { func Uint32ToOffset(offset uint32) Offset {
return Offset(offset) return Offset(offset)
} }
func BytesToOffset(bytes []byte) (Offset) { func BytesToOffset(bytes []byte) Offset {
return Offset(util.BytesToUint32(bytes[0:4])) return Offset(util.BytesToUint32(bytes[0:4]))
} }

View File

@@ -5,8 +5,8 @@ import (
"os" "os"
"time" "time"
. "github.com/chrislusf/seaweedfs/weed/storage/types"
"github.com/chrislusf/seaweedfs/weed/glog" "github.com/chrislusf/seaweedfs/weed/glog"
. "github.com/chrislusf/seaweedfs/weed/storage/types"
"github.com/chrislusf/seaweedfs/weed/util" "github.com/chrislusf/seaweedfs/weed/util"
) )

View File

@@ -1,11 +1,11 @@
package storage package storage
import ( import (
"github.com/chrislusf/seaweedfs/weed/storage/types"
"io/ioutil" "io/ioutil"
"math/rand" "math/rand"
"os" "os"
"testing" "testing"
"github.com/chrislusf/seaweedfs/weed/storage/types"
) )
/* /*