| 33 | } |
| 34 | |
| 35 | public @Nullable V get(@NotNull K key) { |
| 36 | var value = lru.get(key); |
| 37 | if (value != null) |
| 38 | return value; |
| 39 | var bbKey = originTable.encodeKey(key); |
| 40 | var valueRaw = table.get(bbKey.Bytes, bbKey.ReadIndex, bbKey.size()); |
| 41 | if (valueRaw == null) |
| 42 | return null; |
| 43 | value = originTable.newValue(); |
| 44 | value.decode(ByteBuffer.Wrap(valueRaw)); |
| 45 | lru.put(key, value); |
| 46 | return value; |
| 47 | } |
| 48 | |
| 49 | @SuppressWarnings("unchecked") |
| 50 | public K apply(@NotNull BTableKey tableKey, @NotNull Binary changes) throws Exception { |