|
|
@ -53,14 +53,14 @@ func doLoading(file *os.File, nm *NeedleMap) (*NeedleMap, error) { |
|
|
|
nm.FileCounter++ |
|
|
|
nm.FileByteCounter = nm.FileByteCounter + uint64(size) |
|
|
|
oldOffset, oldSize := nm.m.Set(needle.Key(key), offset, size) |
|
|
|
glog.V(3).Infoln("reading key", key, "offset", offset*NeedlePaddingSize, "size", size, "oldSize", oldSize) |
|
|
|
// glog.V(3).Infoln("reading key", key, "offset", offset*NeedlePaddingSize, "size", size, "oldSize", oldSize)
|
|
|
|
if oldOffset > 0 && oldSize != TombstoneFileSize { |
|
|
|
nm.DeletionCounter++ |
|
|
|
nm.DeletionByteCounter = nm.DeletionByteCounter + uint64(oldSize) |
|
|
|
} |
|
|
|
} else { |
|
|
|
oldSize := nm.m.Delete(needle.Key(key)) |
|
|
|
glog.V(3).Infoln("removing key", key, "offset", offset*NeedlePaddingSize, "size", size, "oldSize", oldSize) |
|
|
|
// glog.V(3).Infoln("removing key", key, "offset", offset*NeedlePaddingSize, "size", size, "oldSize", oldSize)
|
|
|
|
nm.DeletionCounter++ |
|
|
|
nm.DeletionByteCounter = nm.DeletionByteCounter + uint64(oldSize) |
|
|
|
} |
|
|
|