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 2021/10/12 01:05:12 UTC

[GitHub] [ozone] mukul1987 commented on a change in pull request #2731: HDDS-5842. Parse and dump SCM ratis segment file to printable text

mukul1987 commented on a change in pull request #2731:
URL: https://github.com/apache/ozone/pull/2731#discussion_r726685693



##########
File path: hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/ha/SCMRatisRequest.java
##########
@@ -139,4 +145,22 @@ public static SCMRatisRequest decode(Message message)
         method.getName(), parameterTypes, args.toArray());
   }
 
+  /**
+   * Convert StateMachineLogEntryProto to String.
+   * @param proto - {@link StateMachineLogEntryProto}
+   * @return String
+   */
+  public static String smProtoToString(StateMachineLogEntryProto proto) {
+    StringBuilder builder = new StringBuilder();
+    try {
+      builder.append(TextFormat.shortDebugString(
+          SCMRatisRequestProto.parseFrom(proto.getLogData().toByteArray())));
+    } catch (Throwable ex) {
+      LOG.info("smProtoToString failed", ex);

Review comment:
       LOG.error here ?




-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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