dain / leveldb

Port of LevelDB to Java

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

why use table.ceilingEntry(internalKey)?

XbuLee opened this issue · comments

commented

in this method ,why use method table.ceilingEntry() instead of method table.get() ?
in my opintion ,skipListMap can not set null value, if the return value is null, then it means that the map does not have this value.

    Slice slice = table.get(internalKey);
    if(slice==null){
      return null;
    }
    if(internalKey.getValueType() == ValueType.DELETION){
      return LookupResult.deleted(key);
    }else {
      return LookupResult.ok(key, slice);
    }
  }