prateekm commented on a change in pull request #1117: [SAMZA-2283] Samza Sql 
Diagnostics: use Microsecond for logical operator processing time and query 
latency
URL: https://github.com/apache/samza/pull/1117#discussion_r320443243
 
 

 ##########
 File path: 
samza-sql/src/main/java/org/apache/samza/sql/data/SamzaSqlRelMsgMetadata.java
 ##########
 @@ -56,60 +55,82 @@
    * TODO: copy eventTime through from source to RelMessage
    */
   @JsonProperty("eventTime")
-  private String eventTime;
+  private long eventTime = 0L;
 
   /**
    * the timestamp of when Samza App received the event
    * TODO: set arrivalTime during conversion from IME to SamzaMessage
    */
   @JsonProperty("arrivalTime")
-  private String arrivalTime;
+  private long arrivalTime = 0L;
 
   /**
-   * the timestamp when SamzaSQL query starts processing the event
-   * set by the SamzaSQL Scan operator
+   * the System.nanoTime when SamzaSQL query starts processing the event
+   * set by the SamzaSQL Scan operator, used by QueryTranslator to calculate
+   * the Query Latency
+   *
+   * Note: using JsonPeoperty("scanTim") for backward compatibility
    */
   @JsonProperty("scanTime")
-  private String scanTime;
+  private long scanTimeNanos = 0L;
 
-  public SamzaSqlRelMsgMetadata(@JsonProperty("eventTime") String eventTime, 
@JsonProperty("arrivalTime") String arrivalTime,
-      @JsonProperty("scanTime") String scanTime) {
+  /**
+   * the tiemstamp when SamzSQL wuery starts processing the event
+   * set by the SamzaSQL Scan oeprator, used by QueryTranslator to calculate
+   * the Queuing Latency
+   */
+  @JsonProperty("scanTimeMillis")
+  private long scanTimeMillis = 0L;
+
+  public SamzaSqlRelMsgMetadata(@JsonProperty("eventTime") long eventTime, 
@JsonProperty("arrivalTime") long arrivalTime,
+      @JsonProperty("scanTime") long scanTimeNanos, 
@JsonProperty("scanTimeMillis") long scanTimeMillis) {
     this.eventTime = eventTime;
     this.arrivalTime = arrivalTime;
-    this.scanTime = scanTime;
+    this.scanTimeNanos = scanTimeNanos;
+    this.scanTimeMillis = scanTimeMillis;
   }
 
-  public SamzaSqlRelMsgMetadata(String eventTime, String arrivalTime, String 
scanTime, boolean isNewInputMessage) {
-    this(eventTime, arrivalTime, scanTime);
+  public SamzaSqlRelMsgMetadata(long eventTime, long arrivalTime, long 
scanTimeNanos, long scanTimeMillis,
+      boolean isNewInputMessage) {
+    this(eventTime, arrivalTime, scanTimeNanos, scanTimeMillis);
     this.isNewInputMessage = isNewInputMessage;
   }
 
-  @JsonProperty("eventTime")
-  public String getEventTime() { return eventTime;}
+  public SamzaSqlRelMsgMetadata(long eventTime, long arrivalTime) {
+    this(eventTime, arrivalTime, 0L, 0L);
+  }
+
 
-  public void setEventTime(String eventTime) {
+      @JsonProperty("eventTime")
+  public long getEventTime() { return eventTime;}
+
+  public void setEventTime(long eventTime) {
     this.eventTime = eventTime;
   }
 
-  public boolean hasEventTime() { return eventTime != null && 
!eventTime.isEmpty(); }
+  public boolean hasEventTime() { return eventTime != 0L; }
 
   @JsonProperty("arrivalTime")
-  public String getarrivalTime() { return arrivalTime;}
+  public long getArrivalTime() { return arrivalTime;}
 
-  public void setArrivalTime(String arrivalTime) {
+  public void setArrivalTime(long arrivalTime) {
     this.arrivalTime = arrivalTime;
   }
 
-  public boolean hasArrivalTime() { return arrivalTime != null && 
!arrivalTime.isEmpty(); }
+  public boolean hasArrivalTime() { return arrivalTime != 0L; }
 
   @JsonProperty("scanTime")
-  public String getscanTime() { return scanTime;}
+  public long getscanTimeNanos() { return scanTimeNanos;}
 
 Review comment:
   `getScanTimeNanos` (uppercase S)

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