Class FastByteOperations
- java.lang.Object
-
- org.apache.cassandra.spark.bulkwriter.util.FastByteOperations
-
public final class FastByteOperations extends java.lang.ObjectUtility code to do optimized byte-array comparison. This is borrowed and slightly modified from Guava'sUnsignedBytesclass to be able to compare arrays that start at non-zero offsets. NOTE: This was lifted from Cassandra 2.1 and reduced to the minimum number of methods necessary for the Spark Bulk Writer. Tests in Cassandra, not ported here as more copy/paste didn't seem to be valuable. Also tested via DecoratedKeyTest.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceFastByteOperations.ByteOperationsstatic classFastByteOperations.PureJavaOperationsstatic classFastByteOperations.UnsafeOperations
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static intcompareUnsigned(java.nio.ByteBuffer buffer1, java.nio.ByteBuffer buffer2)Lexicographically compare two byte arrays
-
-
-
Method Detail
-
compareUnsigned
public static int compareUnsigned(java.nio.ByteBuffer buffer1, java.nio.ByteBuffer buffer2)Lexicographically compare two byte arrays- Parameters:
buffer1- the first bytebufferbuffer2- the second byteburrer- Returns:
- standard java comparison return value (-1 for <, 0 for ==, and 1 for >)
-
-