jhungund commented on code in PR #6183:
URL: https://github.com/apache/hbase/pull/6183#discussion_r1736104956
##########
hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/bucket/BucketCache.java:
##########
@@ -1345,6 +1366,24 @@ static List<RAMQueueEntry>
getRAMQueueEntries(BlockingQueue<RAMQueueEntry> q,
return receptacle;
}
+ byte[] convertToBytes (long value) {
+ byte[] bytes = new byte[Long.BYTES];
+ int length = bytes.length;
+ for (int i = 0; i < length; i++) {
+ bytes[length - i - 1] = (byte) (value & 0xFF);
+ value >>= 8;
+ }
+ return bytes;
+ }
+
+ long convertToLong(byte[] bytes) {
+ long value = 0;
+ for (byte b : bytes) {
+ value = (value << 8) + (b & 0xFF);
+ }
+ return value;
+ }
+
Review Comment:
ok, let me use those.
--
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]