You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2019/12/07 07:29:37 UTC

[GitHub] [hadoop-ozone] mukul1987 commented on a change in pull request #298: HDDS-2389. add toStateMachineLogEntryString provider in Ozone's ContainerStateMachine.

mukul1987 commented on a change in pull request #298: HDDS-2389. add toStateMachineLogEntryString provider in Ozone's ContainerStateMachine.
URL: https://github.com/apache/hadoop-ozone/pull/298#discussion_r355106250
 
 

 ##########
 File path: hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/transport/server/ratis/ContainerStateMachine.java
 ##########
 @@ -862,4 +864,48 @@ public void notifyLeaderChanged(RaftGroupMemberId groupMemberId,
                                   RaftPeerId raftPeerId) {
     ratisServer.handleLeaderChangedNotification(groupMemberId, raftPeerId);
   }
+
+  @Override
+  public String toStateMachineLogEntryString(StateMachineLogEntryProto proto) {
+    try {
+      ContainerCommandRequestProto requestProto =
+              getContainerCommandRequestProto(proto.getLogData());
+      return getWriteChunkInfo(requestProto);
+    } catch (Throwable t) {
+      return "";
+    }
+  }
+
+  private String getWriteChunkInfo(ContainerCommandRequestProto requestProto) {
+    StringBuilder builder = new StringBuilder();
+    Preconditions.checkArgument(requestProto.getCmdType() == Type.WriteChunk);
 
 Review comment:
   Done, added a switch case with only one handling for writeChunk.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: ozone-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: ozone-issues-help@hadoop.apache.org