mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-10-22 03:57:23 +08:00
go fmt
This commit is contained in:
@@ -279,10 +279,10 @@ func toNeedleValue(snve SectionalNeedleValueExtra, snv SectionalNeedleValue, cs
|
||||
|
||||
func (nv NeedleValue) toSectionalNeedleValue(cs *CompactSection) (SectionalNeedleValue, SectionalNeedleValueExtra) {
|
||||
return SectionalNeedleValue{
|
||||
SectionalNeedleId(nv.Key - cs.start),
|
||||
nv.Offset.OffsetLower,
|
||||
nv.Size,
|
||||
}, SectionalNeedleValueExtra{
|
||||
nv.Offset.OffsetHigher,
|
||||
}
|
||||
SectionalNeedleId(nv.Key - cs.start),
|
||||
nv.Offset.OffsetLower,
|
||||
nv.Size,
|
||||
}, SectionalNeedleValueExtra{
|
||||
nv.Offset.OffsetHigher,
|
||||
}
|
||||
}
|
||||
|
@@ -15,9 +15,9 @@ type NeedleMapType int
|
||||
|
||||
const (
|
||||
NeedleMapInMemory NeedleMapType = iota
|
||||
NeedleMapLevelDb // small memory footprint, 4MB total, 1 write buffer, 3 block buffer
|
||||
NeedleMapLevelDbMedium // medium memory footprint, 8MB total, 3 write buffer, 5 block buffer
|
||||
NeedleMapLevelDbLarge // large memory footprint, 12MB total, 4write buffer, 8 block buffer
|
||||
NeedleMapLevelDb // small memory footprint, 4MB total, 1 write buffer, 3 block buffer
|
||||
NeedleMapLevelDbMedium // medium memory footprint, 8MB total, 3 write buffer, 5 block buffer
|
||||
NeedleMapLevelDbLarge // large memory footprint, 12MB total, 4write buffer, 8 block buffer
|
||||
)
|
||||
|
||||
type NeedleMapper interface {
|
||||
|
@@ -60,7 +60,6 @@ func (mm mapMetric) MaybeSetMaxFileKey(key NeedleId) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
func newNeedleMapMetricFromIndexFile(r *os.File) (mm *mapMetric, err error) {
|
||||
mm = &mapMetric{}
|
||||
var bf *bloom.BloomFilter
|
||||
|
@@ -22,12 +22,12 @@ type OffsetLower struct {
|
||||
type Cookie uint32
|
||||
|
||||
const (
|
||||
SizeSize = 4 // uint32 size
|
||||
NeedleEntrySize = CookieSize + NeedleIdSize + SizeSize
|
||||
TimestampSize = 8 // int64 size
|
||||
NeedlePaddingSize = 8
|
||||
TombstoneFileSize = math.MaxUint32
|
||||
CookieSize = 4
|
||||
SizeSize = 4 // uint32 size
|
||||
NeedleEntrySize = CookieSize + NeedleIdSize + SizeSize
|
||||
TimestampSize = 8 // int64 size
|
||||
NeedlePaddingSize = 8
|
||||
TombstoneFileSize = math.MaxUint32
|
||||
CookieSize = 4
|
||||
)
|
||||
|
||||
func CookieToBytes(bytes []byte, cookie Cookie) {
|
||||
|
@@ -79,22 +79,22 @@ func (v *Volume) Size() int64 {
|
||||
return 0 // -1 causes integer overflow and the volume to become unwritable.
|
||||
}
|
||||
|
||||
func (v *Volume)IndexFileSize() uint64 {
|
||||
func (v *Volume) IndexFileSize() uint64 {
|
||||
return v.nm.IndexFileSize()
|
||||
}
|
||||
|
||||
func (v *Volume)DataFileSize() uint64 {
|
||||
func (v *Volume) DataFileSize() uint64 {
|
||||
return uint64(v.Size())
|
||||
}
|
||||
|
||||
/**
|
||||
unix time in seconds
|
||||
*/
|
||||
func (v *Volume)LastModifiedTime() uint64 {
|
||||
*/
|
||||
func (v *Volume) LastModifiedTime() uint64 {
|
||||
return v.lastModifiedTime
|
||||
}
|
||||
|
||||
func (v *Volume)FileCount() uint64 {
|
||||
func (v *Volume) FileCount() uint64 {
|
||||
return uint64(v.nm.FileCount())
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user