hanishakoneru commented on a change in pull request #1480:
URL: https://github.com/apache/ozone/pull/1480#discussion_r516996248
##########
File path:
hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/OmUtils.java
##########
@@ -76,6 +78,17 @@
private static final SecureRandom SRAND = new SecureRandom();
private static byte[] randomBytes = new byte[32];
+ private static final long TRANSACTION_ID_SHIFT = 8;
+ // from the 64 bits of ObjectID (long variable), 2 bits are reserved for
+ // epoch and 8 bits for recursive directory creation, if required. This
+ // leaves 54 bits for the transaction ID. Also, the last transaction ID is
+ // reserved for creating S3G volume on OM start {@link
+ // OzoneManager#addS3GVolumeToDB()}.
+ public static final long EPOCH_ID_SHIFT = 62; // 64 - 2
+ public static final long MAX_TRXN_ID = (long) (Math.pow(2, 54) - 2);
+ public static final int EPOCH_WHEN_RATIS_NOT_ENABLED = 1;
Review comment:
Wanted to avoid 0 as we can assume that currently it is 0. This would
give us a way to separate out objectIds created before this fix. If ever, these
non-unique objectIds need to be fixed, it would be easy to identify them.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]