VishnuPriyaChandraSekar commented on code in PR #4691:
URL: https://github.com/apache/solr/pull/4691#discussion_r3707679354


##########
solr/solrj-streaming/src/java/org/apache/solr/client/solrj/io/stream/metrics/StdMetric.java:
##########
@@ -75,11 +70,28 @@ private void init(String functionName, String columnName, 
boolean outputLong) {
   }
 
   @Override
-  public void update(Tuple tuple) {}
+  public void update(Tuple tuple) {
+    Object o = tuple.get(columnName);
+    double val;
+    if (o instanceof Double d) {

Review Comment:
   Could the 'if-else' structure be simplified ?



##########
solr/solrj-streaming/src/java/org/apache/solr/client/solrj/io/stream/metrics/StdMetric.java:
##########
@@ -24,15 +24,10 @@
 import org.apache.solr.client.solrj.io.stream.expr.StreamFactory;
 
 public class StdMetric extends Metric {

Review Comment:
   Could you include java docs for this class ?



##########
solr/solrj-streaming/src/java/org/apache/solr/client/solrj/io/stream/metrics/StdMetric.java:
##########
@@ -75,11 +70,28 @@ private void init(String functionName, String columnName, 
boolean outputLong) {
   }
 
   @Override
-  public void update(Tuple tuple) {}
+  public void update(Tuple tuple) {
+    Object o = tuple.get(columnName);

Review Comment:
   Could the object 'o' be made immutable by declaring it as final ?



##########
solr/solrj-streaming/src/java/org/apache/solr/client/solrj/io/stream/metrics/StdMetric.java:
##########
@@ -89,7 +101,13 @@ public String[] getColumns() {
 
   @Override
   public Number getValue() {

Review Comment:
   Could you include javadocs to understand the purpose of this method ?



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to