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

 ##########
 File path: 
bookkeeper-server/src/main/java/org/apache/bookkeeper/client/api/WriteFlag.java
 ##########
 @@ -57,10 +77,20 @@
      * @return a set of flags
      */
     public static EnumSet<WriteFlag> getWriteFlags(int flagValue) {
+        EnumSet<WriteFlag> writeFlags = EnumSet.noneOf(WriteFlag.class);
         if ((flagValue & DEFERRED_SYNC.value) == DEFERRED_SYNC.value) {
-            return ONLY_DEFERRED_SYNC;
+            writeFlags.add(DEFERRED_SYNC);
+        }
+        if ((flagValue & DIGEST_TYPE_DUMMY.value) == DIGEST_TYPE_DUMMY.value) {
 
 Review comment:
   We cannot have multiple digestTypes being represented by a single int value. 
The server initializes the digestType based on the first ever flag value 
received and doesn't allow it to get updated (unless it was disabled earlier 
and then enabled). 
   
   We would essentially rely on client to ensure that it doesn't get corrupted. 
The writeFlags would be automatically set based on digestType. If the client 
re-opens a writeHandle again (for example, replication), then those bits would 
be automatically set based on metadata. 

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