cameronlee314 commented on a change in pull request #71: SAMZA-2437: Sample for 
producing to Azure Blob Storage
URL: https://github.com/apache/samza-hello-samza/pull/71#discussion_r371586679
 
 

 ##########
 File path: src/main/java/samza/examples/azure/data/PageViewAvroRecord.java
 ##########
 @@ -0,0 +1,48 @@
+package samza.examples.azure.data;
+
+import java.io.Serializable;
+import org.apache.avro.AvroRuntimeException;
+import samza.examples.cookbook.data.PageView;
+
+public class PageViewAvroRecord extends 
org.apache.avro.specific.SpecificRecordBase
+    implements org.apache.avro.specific.SpecificRecord, Serializable {
+  public final org.apache.avro.Schema SCHEMA = org.apache.avro.Schema.parse(
+      
"{\"type\":\"record\",\"name\":\"PageViewAvroRecord\",\"namespace\":\"org.apache.samza.examples.events\",
 \"fields\":[{\"name\": \"userId\", \"type\": \"string\"}, {\"name\": 
\"country\", \"type\": \"string\"}, {\"name\": \"pageId\", \"type\": 
\"string\"}]}");
+
+  private String userId;
+  private String country;
+  private String pageId;
+
+  public static PageViewAvroRecord buildPageViewRecord(PageView pageView) {
+    PageViewAvroRecord record = new PageViewAvroRecord();
+    record.put(0, pageView.userId);
 
 Review comment:
   Would it be cleaner to do `record.userId = pageView.userId`? Same for the 
other fields below.

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


With regards,
Apache Git Services

Reply via email to