sashapolo commented on a change in pull request #562:
URL: https://github.com/apache/ignite-3/pull/562#discussion_r790618527



##########
File path: 
modules/storage-rocksdb/src/main/java/org/apache/ignite/internal/storage/rocksdb/RocksDbPartitionStorage.java
##########
@@ -489,21 +495,12 @@ protected DataRow decodeEntry(byte[] key, byte[] value) {
      * and the key's hash (an optimisation).
      */
     private byte[] partitionKey(byte[] key) {
-        byte[] partitionKey = new byte[PARTITION_KEY_PREFIX_SIZE + key.length];
-
-        int pos = 0;
-
-        intToBytes(partId, partitionKey, pos, Integer.BYTES);
-
-        pos += Integer.BYTES;
-
-        intToBytes(Arrays.hashCode(key), partitionKey, pos, Integer.BYTES);
-
-        pos += Integer.BYTES;
-
-        System.arraycopy(key, 0, partitionKey, pos, key.length);
-
-        return partitionKey;
+        return ByteBuffer.allocate(PARTITION_KEY_PREFIX_SIZE + key.length)
+                .order(ByteOrder.BIG_ENDIAN)
+                .putShort((short) partId)
+                .putInt(Arrays.hashCode(key))

Review comment:
       Left a TODO




-- 
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]


Reply via email to