reddycharan commented on a change in pull request #2182: Add API for Bookie 
checksum verification writeFlags
URL: https://github.com/apache/bookkeeper/pull/2182#discussion_r336281376
 
 

 ##########
 File path: 
bookkeeper-server/src/main/java/org/apache/bookkeeper/client/api/WriteFlag.java
 ##########
 @@ -30,12 +30,32 @@
 public enum WriteFlag {
 
     /**
-     * Writes will be acknowledged after writing to the filesystem
+     * Bit 0 - Writes will be acknowledged after writing to the filesystem
      * but not yet been persisted to disks.
      *
      * @see ForceableHandle#force()
      */
-    DEFERRED_SYNC(0x1 << 0);
+    DEFERRED_SYNC(0x1 << 0),
+    /**
+     * Bits 1,2,3 - value 0.
 
 Review comment:
   1) For digesttype we need 3 bits, instead of taking Bits 1, 2, 3 I would 
suggest you to take Bits 2, 3, 4. This gives some space for SYNC types 
(REGULAR_SYNC and DEFERRED_SYNC). Currently it might need just 2 values (0/1) 
but it is better to be safe to leave space for expansion.
   
   2) For reserving bits for digesttype, we should declare something like 
   `static final int DIGEST_TYPE_BITS                = 0x7 << 2;` By doing so 
we are declaring that we need three bits and it would be bits 2, 3, 4.

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


With regards,
Apache Git Services

Reply via email to