dcapwell commented on code in PR #1774:
URL: https://github.com/apache/cassandra/pull/1774#discussion_r941688551
##########
src/java/org/apache/cassandra/db/commitlog/CommitLog.java:
##########
@@ -291,7 +291,7 @@ public CommitLogPosition add(Mutation mutation) throws
CDCWriteException
buffer.putInt((int) checksum.getValue());
// checksummed mutation
- dos.write(dob.getData(), 0, size);
+ dos.write(dob.unsafeGetBufferAndFlip());
Review Comment:
CommitLog does not hold ref after, `.write` copies the value into its local
buffer.
```
public byte[] getData()
{
assert buffer.arrayOffset() == 0;
return buffer.array();
}
```
this method is no longer safe as it may be direct now...
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]