Skip to content

Commit

Permalink
feat: fix (#364)
Browse files Browse the repository at this point in the history
  • Loading branch information
caojiajun committed Jan 13, 2025
1 parent 93e496e commit 8ad38b9
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public class SlotStringReadWrite {
private final ValueFlushExecutor flushExecutor;

private final Map<KeyInfo, byte[]> mutable = new HashMap<>();
private Map<KeyInfo, byte[]> immutable = new HashMap<>();
private final Map<KeyInfo, byte[]> immutable = new HashMap<>();
private volatile FlushStatus flushStatus = FlushStatus.FLUSH_OK;

public SlotStringReadWrite(short slot, ValueFlushExecutor flushExecutor, StringBlockReadWrite slotStringBlockCache) {
Expand Down Expand Up @@ -78,7 +78,7 @@ public CompletableFuture<FlushResult> flush(Map<Key, KeyInfo> keyMap) throws IOE
}
CompletableFuture<FlushResult> future = new CompletableFuture<>();
Map<Key, byte[]> encodeMap = StringValue.encodeMap(mutable);
immutable = mutable;
immutable.putAll(mutable);
mutable.clear();
flushStatus = FlushStatus.FLUSHING;
CompletableFuture<FlushResult> submit = flushExecutor.submit(new StringValueFlushTask(slot, encodeMap, keyMap));
Expand Down

0 comments on commit 8ad38b9

Please sign in to comment.