Sanil15 commented on a change in pull request #1071: Using jsonserde to write 
metadata file
URL: https://github.com/apache/samza/pull/1071#discussion_r291353969
 
 

 ##########
 File path: samza-core/src/main/java/org/apache/samza/util/DiagnosticsUtil.java
 ##########
 @@ -49,26 +50,34 @@
 public class DiagnosticsUtil {
   private static final Logger log = 
LoggerFactory.getLogger(DiagnosticsUtil.class);
 
+
   // Write a file in the samza.log.dir named {exec-env-container-id}.metadata 
that contains
   // metadata about the container such as containerId, jobName, jobId, 
hostname, timestamp, version info, and others.
+  // The file contents are serialized using {@link JsonSerde}.
   public static void writeMetadataFile(String jobName, String jobId, String 
containerId,
       Optional<String> execEnvContainerId, Config config) {
 
     Option<File> metadataFile = 
JobConfig.getMetadataFile(Option.apply(execEnvContainerId.orElse(null)));
 
     if (metadataFile.isDefined()) {
-
-      StringBuilder metadata = new StringBuilder("Version: 1");
-      metadata.append(System.lineSeparator());
       MetricsHeader metricsHeader =
           new MetricsHeader(jobName, jobId, "samza-container-" + containerId, 
execEnvContainerId.orElse(""), LocalContainerRunner.class.getName(),
               Util.getTaskClassVersion(config), Util.getSamzaVersion(), 
Util.getLocalHost().getHostName(),
               System.currentTimeMillis(), System.currentTimeMillis());
 
+      class MetadataFileContents {
 
 Review comment:
   Can we put the inner class at the bottom?

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