refactor
This commit is contained in:
@@ -10,7 +10,7 @@ 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"
|
||||||
"github.com/chrislusf/seaweedfs/weed/util/pb_cache"
|
"github.com/chrislusf/seaweedfs/weed/util/chunk_cache"
|
||||||
"github.com/chrislusf/seaweedfs/weed/wdclient"
|
"github.com/chrislusf/seaweedfs/weed/wdclient"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -22,12 +22,12 @@ type ChunkReadAt struct {
|
|||||||
lookupFileId func(fileId string) (targetUrl string, err error)
|
lookupFileId func(fileId string) (targetUrl string, err error)
|
||||||
readerLock sync.Mutex
|
readerLock sync.Mutex
|
||||||
|
|
||||||
chunkCache *pb_cache.ChunkCache
|
chunkCache *chunk_cache.ChunkCache
|
||||||
}
|
}
|
||||||
|
|
||||||
// var _ = io.ReaderAt(&ChunkReadAt{})
|
// var _ = io.ReaderAt(&ChunkReadAt{})
|
||||||
|
|
||||||
func NewChunkReaderAtFromClient(filerClient filer_pb.FilerClient, chunkViews []*ChunkView, chunkCache *pb_cache.ChunkCache) *ChunkReadAt {
|
func NewChunkReaderAtFromClient(filerClient filer_pb.FilerClient, chunkViews []*ChunkView, chunkCache *chunk_cache.ChunkCache) *ChunkReadAt {
|
||||||
|
|
||||||
return &ChunkReadAt{
|
return &ChunkReadAt{
|
||||||
chunkViews: chunkViews,
|
chunkViews: chunkViews,
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ import (
|
|||||||
"github.com/chrislusf/seaweedfs/weed/pb"
|
"github.com/chrislusf/seaweedfs/weed/pb"
|
||||||
"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"
|
||||||
"github.com/chrislusf/seaweedfs/weed/util/pb_cache"
|
"github.com/chrislusf/seaweedfs/weed/util/chunk_cache"
|
||||||
"github.com/seaweedfs/fuse"
|
"github.com/seaweedfs/fuse"
|
||||||
"github.com/seaweedfs/fuse/fs"
|
"github.com/seaweedfs/fuse/fs"
|
||||||
)
|
)
|
||||||
@@ -64,7 +64,7 @@ type WFS struct {
|
|||||||
root fs.Node
|
root fs.Node
|
||||||
fsNodeCache *FsCache
|
fsNodeCache *FsCache
|
||||||
|
|
||||||
chunkCache *pb_cache.ChunkCache
|
chunkCache *chunk_cache.ChunkCache
|
||||||
}
|
}
|
||||||
type statsCache struct {
|
type statsCache struct {
|
||||||
filer_pb.StatisticsResponse
|
filer_pb.StatisticsResponse
|
||||||
@@ -81,7 +81,7 @@ func NewSeaweedFileSystem(option *Option) *WFS {
|
|||||||
return make([]byte, option.ChunkSizeLimit)
|
return make([]byte, option.ChunkSizeLimit)
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
chunkCache: pb_cache.NewChunkCache(option.ChunkCacheCountLimit),
|
chunkCache: chunk_cache.NewChunkCache(option.ChunkCacheCountLimit),
|
||||||
}
|
}
|
||||||
|
|
||||||
wfs.root = &Dir{name: wfs.option.FilerMountRootPath, wfs: wfs}
|
wfs.root = &Dir{name: wfs.option.FilerMountRootPath, wfs: wfs}
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ import (
|
|||||||
"github.com/chrislusf/seaweedfs/weed/pb"
|
"github.com/chrislusf/seaweedfs/weed/pb"
|
||||||
"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"
|
||||||
"github.com/chrislusf/seaweedfs/weed/util/pb_cache"
|
"github.com/chrislusf/seaweedfs/weed/util/chunk_cache"
|
||||||
|
|
||||||
"github.com/chrislusf/seaweedfs/weed/filer2"
|
"github.com/chrislusf/seaweedfs/weed/filer2"
|
||||||
"github.com/chrislusf/seaweedfs/weed/glog"
|
"github.com/chrislusf/seaweedfs/weed/glog"
|
||||||
@@ -67,7 +67,7 @@ type WebDavFileSystem struct {
|
|||||||
secret security.SigningKey
|
secret security.SigningKey
|
||||||
filer *filer2.Filer
|
filer *filer2.Filer
|
||||||
grpcDialOption grpc.DialOption
|
grpcDialOption grpc.DialOption
|
||||||
chunkCache *pb_cache.ChunkCache
|
chunkCache *chunk_cache.ChunkCache
|
||||||
}
|
}
|
||||||
|
|
||||||
type FileInfo struct {
|
type FileInfo struct {
|
||||||
@@ -98,7 +98,7 @@ type WebDavFile struct {
|
|||||||
func NewWebDavFileSystem(option *WebDavOption) (webdav.FileSystem, error) {
|
func NewWebDavFileSystem(option *WebDavOption) (webdav.FileSystem, error) {
|
||||||
return &WebDavFileSystem{
|
return &WebDavFileSystem{
|
||||||
option: option,
|
option: option,
|
||||||
chunkCache: pb_cache.NewChunkCache(1000),
|
chunkCache: chunk_cache.NewChunkCache(1000),
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
package pb_cache
|
package chunk_cache
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"time"
|
"time"
|
||||||
Reference in New Issue
Block a user