Package org.apache.hadoop.hbase.util
Class TestByteBufferUtils
java.lang.Object
org.apache.hadoop.hbase.util.TestByteBufferUtils
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate byte[]static final HBaseClassTestRuleprivate static final intprivate static final Collection<Long>private static final Stringprivate static final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static voidstatic void(package private) static void(package private) static voidprivate static voidfillArray(byte[] bb, byte b) private static voidfillBB(ByteBuffer bb, byte b) static Collection<Object[]>private static voidvoidsetUp()Create an array with sample data.voidTest if we are comparing equal bytes.voidvoidTest 7-bit encoding of integers.private voidtestCompressedInt(int value) voidvoidvoidTest copying from buffer.voidvoidprivate voidtestCopyFromSrcToDestWithThreads(Object input, Object output, List<Integer> lengthes, List<Integer> offsets) voidTest copying data from stream.voidTest copying to stream from buffer with offset.voidvoidvoidTest how much bytes we need to store integer.voidTest how much bytes we need to store long.voidTest copying to stream from buffer.voidTest serializing int to bytesprivate voidtestPutInt(int value) voidvoidvoidvoidvoid
-
Field Details
-
CLASS_RULE
-
UNSAFE_AVAIL_NAME
- See Also:
-
UNSAFE_UNALIGNED_NAME
- See Also:
-
array
-
MAX_VLONG_LENGTH
- See Also:
-
testNumbers
-
-
Constructor Details
-
TestByteBufferUtils
- Throws:
Exception
-
-
Method Details
-
afterClass
- Throws:
Exception
-
parameters
-
setUnsafe
- Throws:
Exception
-
disableUnsafe
- Throws:
Exception
-
detectAvailabilityOfUnsafe
- Throws:
Exception
-
setUp
Create an array with sample data. -
addNumber
-
testReadWriteVLong
-
testReadWriteConsecutiveVLong
-
testConsistencyWithHadoopVLong
- Throws:
IOException
-
testMoveBufferToStream
Test copying to stream from buffer.- Throws:
IOException
-
testCopyToStreamWithOffset
Test copying to stream from buffer with offset.- Throws:
IOException- On test failure.
-
testCopyFromStream
Test copying data from stream.- Throws:
IOException- On test failure.
-
testCopyFromBuffer
Test copying from buffer. -
testCompressedInt
Test 7-bit encoding of integers.- Throws:
IOException- On test failure.
-
testIntFitsIn
Test how much bytes we need to store integer. -
testLongFitsIn
Test how much bytes we need to store long. -
testArePartEqual
Test if we are comparing equal bytes. -
testPutInt
Test serializing int to bytes -
testCompressedInt
- Throws:
IOException
-
testPutInt
-
testToBytes
-
testToPrimitiveTypes
-
testCopyFromArrayToBuffer
-
testCopyFromSrcToDestWithThreads
private void testCopyFromSrcToDestWithThreads(Object input, Object output, List<Integer> lengthes, List<Integer> offsets) throws InterruptedException - Throws:
InterruptedException
-
testCopyFromSrcToDestWithThreads
- Throws:
InterruptedException
-
testCopyFromBufferToArray
-
testRelativeCopyFromBuffertoBuffer
-
testCompareTo
-
testEquals
-
testFindCommonPrefix
-
fillBB
-
fillArray
-