You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@zeppelin.apache.org by GitBox <gi...@apache.org> on 2021/06/23 14:36:44 UTC

[GitHub] [zeppelin] cuspymd opened a new pull request #4150: [ZEPPELIN-5425] Polish Interpreter class

cuspymd opened a new pull request #4150:
URL: https://github.com/apache/zeppelin/pull/4150


   ### What is this PR for?
   - Move `interpolate()` function into `AbstractInterpreter` class which is only one caller of this function
   - Fix IDE warning messages
   
   
   ### What type of PR is it?
   [Refactoring]
   
   ### What is the Jira issue?
   * https://issues.apache.org/jira/browse/ZEPPELIN-5425
   
   ### How should this be tested?
   * Unit tests and CI
   
   ### Questions:
   * Does the licenses files need update? No
   * Is there breaking changes for older versions? No
   * Does this needs documentation? No
   


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



[GitHub] [zeppelin] zjffdu commented on a change in pull request #4150: [ZEPPELIN-5425] Polish Interpreter class

Posted by GitBox <gi...@apache.org>.
zjffdu commented on a change in pull request #4150:
URL: https://github.com/apache/zeppelin/pull/4150#discussion_r659135001



##########
File path: zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/AbstractInterpreter.java
##########
@@ -47,6 +51,35 @@ public InterpreterResult interpret(String st,
     return internalInterpret(st, context);
   }
 
+  static String interpolate(String cmd, ResourcePool resourcePool) {
+    Pattern zVariablePattern = Pattern.compile("([^{}]*)([{]+[^{}]*[}]+)(.*)", Pattern.DOTALL);

Review comment:
       Move it outside as static variable ? 




-- 
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: dev-unsubscribe@zeppelin.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [zeppelin] cuspymd commented on a change in pull request #4150: [ZEPPELIN-5425] Polish Interpreter class

Posted by GitBox <gi...@apache.org>.
cuspymd commented on a change in pull request #4150:
URL: https://github.com/apache/zeppelin/pull/4150#discussion_r662392195



##########
File path: zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/AbstractInterpreter.java
##########
@@ -47,6 +51,35 @@ public InterpreterResult interpret(String st,
     return internalInterpret(st, context);
   }
 
+  static String interpolate(String cmd, ResourcePool resourcePool) {
+    Pattern zVariablePattern = Pattern.compile("([^{}]*)([{]+[^{}]*[}]+)(.*)", Pattern.DOTALL);

Review comment:
       I fixed. But No difference was found from the execution time of `ZeppCtxtVariableTest`.
   Below is the execution time of 18 tests of `ZeppCtxtVariableTest`. (measured 10 times each)
   statistics | before (ms) | after (ms) 
   -------|--------|-------
   average | 235.6| 234.6
   std. dev. | 12.6 | 26.5




-- 
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: dev-unsubscribe@zeppelin.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [zeppelin] Reamer commented on a change in pull request #4150: [ZEPPELIN-5425] Polish Interpreter class

Posted by GitBox <gi...@apache.org>.
Reamer commented on a change in pull request #4150:
URL: https://github.com/apache/zeppelin/pull/4150#discussion_r659318903



##########
File path: zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/AbstractInterpreter.java
##########
@@ -47,6 +51,35 @@ public InterpreterResult interpret(String st,
     return internalInterpret(st, context);
   }
 
+  static String interpolate(String cmd, ResourcePool resourcePool) {
+    Pattern zVariablePattern = Pattern.compile("([^{}]*)([{]+[^{}]*[}]+)(.*)", Pattern.DOTALL);

Review comment:
       With `static` and `final` :grin: 
   https://rules.sonarsource.com/java/tag/performance/RSPEC-4248




-- 
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: dev-unsubscribe@zeppelin.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [zeppelin] zjffdu commented on pull request #4150: [ZEPPELIN-5425] Polish Interpreter class

Posted by GitBox <gi...@apache.org>.
zjffdu commented on pull request #4150:
URL: https://github.com/apache/zeppelin/pull/4150#issuecomment-873395875


   LGTM


-- 
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: dev-unsubscribe@zeppelin.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [zeppelin] Reamer commented on pull request #4150: [ZEPPELIN-5425] Polish Interpreter class

Posted by GitBox <gi...@apache.org>.
Reamer commented on pull request #4150:
URL: https://github.com/apache/zeppelin/pull/4150#issuecomment-868303453


   I restarted the CI because many tests failed, which does not seem to be related to these changes.


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



[GitHub] [zeppelin] cuspymd commented on a change in pull request #4150: [ZEPPELIN-5425] Polish Interpreter class

Posted by GitBox <gi...@apache.org>.
cuspymd commented on a change in pull request #4150:
URL: https://github.com/apache/zeppelin/pull/4150#discussion_r662392195



##########
File path: zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/AbstractInterpreter.java
##########
@@ -47,6 +51,35 @@ public InterpreterResult interpret(String st,
     return internalInterpret(st, context);
   }
 
+  static String interpolate(String cmd, ResourcePool resourcePool) {
+    Pattern zVariablePattern = Pattern.compile("([^{}]*)([{]+[^{}]*[}]+)(.*)", Pattern.DOTALL);

Review comment:
       I fixed. But No difference was found from the execution time of `ZeppCtxtVariableTest`.
   Below is the total execution time of 18 tests of `ZeppCtxtVariableTest`. (measured 10 times each)
   statistics | before (ms) | after (ms) 
   -------|--------|-------
   average | 235.6| 234.6
   std. dev. | 12.6 | 26.5




-- 
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: dev-unsubscribe@zeppelin.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [zeppelin] asfgit closed pull request #4150: [ZEPPELIN-5425] Polish Interpreter class

Posted by GitBox <gi...@apache.org>.
asfgit closed pull request #4150:
URL: https://github.com/apache/zeppelin/pull/4150


   


-- 
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: dev-unsubscribe@zeppelin.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org