Rename Skiplist::Size to MemSize

This commit is contained in:
Sam Hughes
2017-08-13 20:41:49 -07:00
parent d2e6a4bca5
commit 5bdeeba526
2 changed files with 5 additions and 3 deletions
+2 -2
View File
@@ -981,7 +981,7 @@ func (s *KV) ensureRoomForWrite() error {
var err error
s.Lock()
defer s.Unlock()
if s.mt.Size() < s.opt.MaxTableSize {
if s.mt.MemSize() < s.opt.MaxTableSize {
return nil
}
@@ -996,7 +996,7 @@ func (s *KV) ensureRoomForWrite() error {
}
s.elog.Printf("Flushing memtable, mt.size=%d size of flushChan: %d\n",
s.mt.Size(), len(s.flushChan))
s.mt.MemSize(), len(s.flushChan))
// We manage to push this task. Let's modify imm.
s.imm = append(s.imm, s.mt)
s.mt = skl.NewSkiplist(arenaSize(&s.opt))
+3 -1
View File
@@ -385,7 +385,9 @@ func (s *Skiplist) NewIterator() *Iterator {
return &Iterator{list: s}
}
func (s *Skiplist) Size() int64 { return s.arena.Size() }
// MemSize returns the size of the Skiplist in terms of how much memory is used within its internal
// arena.
func (s *Skiplist) MemSize() int64 { return s.arena.Size() }
// Iterator is an iterator over skiplist object. For new objects, you just
// need to initialize Iterator.list.