You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pr@cassandra.apache.org by GitBox <gi...@apache.org> on 2023/01/12 15:27:44 UTC

[GitHub] [cassandra] belliottsmith commented on a diff in pull request #2073: (Accord) Split shards by contiguous ranges within a node

belliottsmith commented on code in PR #2073:
URL: https://github.com/apache/cassandra/pull/2073#discussion_r1068265183


##########
src/java/org/apache/cassandra/db/marshal/ByteArrayAccessor.java:
##########
@@ -107,6 +108,7 @@ public byte[] read(DataInputPlus in, int length) throws IOException
     @Override
     public byte[] slice(byte[] input, int offset, int length)
     {
+        Invariants.checkArgument(offset + length <= input.length);

Review Comment:
   `Invariants` is a replacement for `Preconditions` and is otherwise largely equivalent. Though it is brought in from accord-core rather than Guava. I don't mind sticking to `Preconditions` in C*, but the switch in Accord was to make it easier to catch application-level faults in the debugger as a lot of libraries have failed `Preconditions` trigger repeatedly. Also, it's a better name, and we have flexibility to modify/expand it as necessary.



-- 
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: pr-unsubscribe@cassandra.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org