add mountOptions.chunkSizeLimitMB, remove cmdMount.IsDebug
This commit is contained in:
@@ -59,7 +59,13 @@ func (pages *ContinuousDirtyPages) AddPage(ctx context.Context, offset int64, da
|
||||
Offset: offset,
|
||||
Data: data,
|
||||
})
|
||||
return nil, nil
|
||||
|
||||
if pages.totalSize() >= pages.f.wfs.chunkSizeLimit {
|
||||
chunk, err = pages.saveToStorage(ctx)
|
||||
pages.pages = nil
|
||||
glog.V(3).Infof("%s/%s add split [%d,%d)", pages.f.dir.Path, pages.f.Name, chunk.Offset, chunk.Offset+int64(chunk.Size))
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
chunk, err = pages.saveToStorage(ctx)
|
||||
|
||||
@@ -13,14 +13,16 @@ type WFS struct {
|
||||
listDirectoryEntriesCache *ccache.Cache
|
||||
collection string
|
||||
replication string
|
||||
chunkSizeLimit int64
|
||||
}
|
||||
|
||||
func NewSeaweedFileSystem(filer string, collection string, replication string) *WFS {
|
||||
func NewSeaweedFileSystem(filer string, collection string, replication string, chunkSizeLimitMB int) *WFS {
|
||||
return &WFS{
|
||||
filer: filer,
|
||||
listDirectoryEntriesCache: ccache.New(ccache.Configure().MaxSize(6000).ItemsToPrune(100)),
|
||||
collection: collection,
|
||||
replication: replication,
|
||||
chunkSizeLimit: int64(chunkSizeLimitMB) * 1024 * 1024,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user