maedhroz commented on code in PR #2267:
URL: https://github.com/apache/cassandra/pull/2267#discussion_r1162099203
##########
src/java/org/apache/cassandra/io/compress/CompressedSequentialWriter.java:
##########
@@ -337,6 +337,41 @@ private void seekToChunkStart()
}
}
+ // Page management using chunk boundaries
+
+ @Override
+ public int maxBytesInPage()
+ {
+ return buffer.capacity();
+ }
+
+ @Override
+ public void padToPageBoundary() throws IOException
+ {
+ if (buffer.position() == 0)
+ return;
+
+ int padLength = buffer.remaining();
+
+ // Flush as much as we have
+ doFlush(0);
+ // But pretend we had a whole chunk
+ bufferOffset += padLength;
+ lastFlushOffset += padLength;
+ }
+
+ @Override
+ public int bytesLeftInPage()
+ {
+ return buffer.remaining();
+ }
+
+ @Override
+ public long paddedPosition()
+ {
+ return position() + (buffer.position() == 0 ? 0 : buffer.remaining());
+ }
+
Review Comment:
nit: Didn't find any test coverage for these new padding-related methods,
but my search was probably too shallow...
--
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]