]> git-server-git.apps.pok.os.sepia.ceph.com Git - rocksdb.git/commitdiff
Fixing and adding some comments
authorKosie van der Merwe <kosie.vandermerwe@gmail.com>
Fri, 4 Jan 2013 01:13:56 +0000 (17:13 -0800)
committerKosie van der Merwe <kosie.vandermerwe@gmail.com>
Fri, 4 Jan 2013 01:13:56 +0000 (17:13 -0800)
Summary:
`MemTableList::Add()` neglected to mention that it took ownership of the reference held by its caller.

The comment in `MemTable::Get()` was wrong in describing the format of the key.

Test Plan: None

Reviewers: dhruba, sheki, emayanke, vamsi

Reviewed By: dhruba

CC: leveldb
Differential Revision: https://reviews.facebook.net/D7755

db/memtable.cc
db/memtable.h
db/memtablelist.h

index 64ee41648e0008b34a1378cd22aff1cbcb71b7e6..1f6a9d26651b321f7641630a77299073c3cc0f0f 100644 (file)
@@ -116,7 +116,7 @@ bool MemTable::Get(const LookupKey& key, std::string* value, Status* s) {
   if (iter.Valid()) {
     // entry format is:
     //    klength  varint32
-    //    userkey  char[klength]
+    //    userkey  char[klength-8]
     //    tag      uint64
     //    vlength  varint32
     //    value    char[vlength]
index c70f2dc3e293ed933eb936cacd2d268d4e877bee..31e2aef1d86503d4fb7e98ff82dce34c3c79ab04 100644 (file)
@@ -49,7 +49,7 @@ class MemTable {
   // The caller must ensure that the underlying MemTable remains live
   // while the returned iterator is live.  The keys returned by this
   // iterator are internal keys encoded by AppendInternalKey in the
-  // db/format.{h,cc} module.
+  // db/dbformat.{h,cc} module.
   Iterator* NewIterator();
 
   // Add an entry into memtable that maps key to value at the
index 721b344ab7558a3d264f91ae4df8cb13022afa1c..266799f4bb0041ff20351f41eba3ecc42f9367e9 100644 (file)
@@ -63,6 +63,7 @@ class MemTableList {
                       std::set<uint64_t>& pending_outputs);
 
   // New memtables are inserted at the front of the list.
+  // Takes ownership of the referenced held on *m by the caller of Add().
   void Add(MemTable* m);
 
   // Returns an estimate of the number of bytes of data in use.