Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SAMZA-2002: SamzaSQL Diagnostics: instrument rest of operators (excep…
…t join & aggregate) and at Query level Second phase of instrumenting SamzaSQL operators to add and maintain metrics. All operators, except join and aggregate, are instrumented to add Processing Time and Input Rate metrics. Whenever output rate could be different (e.g., filter operator) the output rate is also added. At query level, we have Query Latency, and input and output rates. Author: Shenoda Guirguis <sguirguis@linkedin.com> Reviewers: Srinivasulu Punuru <spunuru@linkedin.com>, Aditya Toomula <atoomula@linkedin.com> Closes #831 from shenodaguirguis/addmetrics.3
- Loading branch information
1 parent
b126683
commit bd9387b
Showing
21 changed files
with
541 additions
and
139 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
105 changes: 105 additions & 0 deletions
105
samza-sql/src/main/java/org/apache/samza/sql/data/SamzaSqlRelMsgMetadata.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
package org.apache.samza.sql.data; | ||
|
||
import java.io.Serializable; | ||
import org.codehaus.jackson.annotate.JsonProperty; | ||
|
||
|
||
/** | ||
* Metadata of Samza Sql Rel Message. Contains metadata about the corresponding event or | ||
* relational row of a table. Used as member of the {@link SamzaSqlRelMessage}. | ||
*/ | ||
public class SamzaSqlRelMsgMetadata implements Serializable { | ||
/** | ||
* boolean to indicate whether this message comes from a new input message or not, in case of | ||
* Project:flatten() is used, to be able to determine the number of original input messages | ||
* default is true for the case when no flatten() is used | ||
*/ | ||
public boolean isNewInputMessage = true; | ||
|
||
/** | ||
* The timestamp of when the events actually happened | ||
* set by and copied from the event source | ||
* TODO: copy eventTime through from source to RelMessage | ||
*/ | ||
@JsonProperty("eventTime") | ||
private String eventTime; | ||
|
||
/** | ||
* the timestamp of when Samza App received the event | ||
* TODO: set arrivalTime during conversion from IME to SamzaMessage | ||
*/ | ||
@JsonProperty("arrivalTime") | ||
private String arrivalTime; | ||
|
||
/** | ||
* the timestamp when SamzaSQL query starts processing the event | ||
* set by the SamzaSQL Scan operator | ||
*/ | ||
@JsonProperty("scanTime") | ||
private String scanTime; | ||
|
||
public SamzaSqlRelMsgMetadata(@JsonProperty("eventTime") String eventTime, @JsonProperty("arrivalTime") String arrivalTime, | ||
@JsonProperty("scanTime") String scanTime) { | ||
this.eventTime = eventTime; | ||
this.arrivalTime = arrivalTime; | ||
this.scanTime = scanTime; | ||
} | ||
|
||
public SamzaSqlRelMsgMetadata(String eventTime, String arrivalTime, String scanTime, boolean isNewInputMessage) { | ||
this(eventTime, arrivalTime, scanTime); | ||
this.isNewInputMessage = isNewInputMessage; | ||
} | ||
|
||
@JsonProperty("eventTime") | ||
public String getEventTime() { return eventTime;} | ||
|
||
public void setEventTime(String eventTime) { | ||
this.eventTime = eventTime; | ||
} | ||
|
||
public boolean hasEventTime() { return eventTime != null && !eventTime.isEmpty(); } | ||
|
||
@JsonProperty("arrivalTime") | ||
public String getarrivalTime() { return arrivalTime;} | ||
|
||
public void setArrivalTime(String arrivalTime) { | ||
this.arrivalTime = arrivalTime; | ||
} | ||
|
||
public boolean hasArrivalTime() { return arrivalTime != null && !arrivalTime.isEmpty(); } | ||
|
||
|
||
@JsonProperty("scanTime") | ||
public String getscanTime() { return scanTime;} | ||
|
||
public void setScanTime(String scanTime) { | ||
this.scanTime = scanTime; | ||
} | ||
|
||
public boolean hasScanTime() { return scanTime != null && !scanTime.isEmpty(); } | ||
|
||
@Override | ||
public String toString() { | ||
return "[Metadata:{" + eventTime + " " + arrivalTime + " " + scanTime + "}]"; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.