mirror of https://github.com/apache/cassandra
Don't allocate in ThreadLocalReadAheadBuffer#close()
Patch by Jordan West; reviewed by Benedict Elliot Smith for CASSANDRA-20551
This commit is contained in:
parent
ec26d53d6c
commit
79c59347be
|
|
@ -1,4 +1,5 @@
|
|||
5.0.5
|
||||
* Don't allocate in ThreadLocalReadAheadBuffer#close() (CASSANDRA-20551)
|
||||
* Ensure RowFilter#isMutableIntersection() properly evaluates numeric ranges on a single column (CASSANDRA-20566)
|
||||
* Switch memtable-related off-heap objects to Native Endian and Memory to Little Endian (CASSANDRA-20190)
|
||||
* SAI marks an index as non-empty when a partial partition/row modifications is flushed due to repair (CASSANDRA-20567)
|
||||
|
|
|
|||
|
|
@ -131,18 +131,21 @@ public final class ThreadLocalReadAheadBuffer
|
|||
|
||||
public void clear(boolean deallocate)
|
||||
{
|
||||
Block block = getBlock();
|
||||
// avoid calling block() here to reduce unintended allocations
|
||||
Block block = blockMap.get().get(channel.filePath());
|
||||
if (block == null)
|
||||
return;
|
||||
|
||||
block.index = -1;
|
||||
if (block.buffer == null)
|
||||
return;
|
||||
|
||||
ByteBuffer blockBuffer = block.buffer;
|
||||
if (blockBuffer != null)
|
||||
blockBuffer.clear();
|
||||
if (deallocate)
|
||||
{
|
||||
blockBuffer.clear();
|
||||
if (deallocate)
|
||||
{
|
||||
FileUtils.clean(blockBuffer);
|
||||
block.buffer = null;
|
||||
}
|
||||
FileUtils.clean(blockBuffer);
|
||||
block.buffer = null;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue