[
https://issues.apache.org/jira/browse/METRON-980?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16034555#comment-16034555
]
ASF GitHub Bot commented on METRON-980:
---------------------------------------
Github user cestella commented on a diff in the pull request:
https://github.com/apache/metron/pull/606#discussion_r119838615
--- Diff:
metron-platform/metron-common/src/test/java/org/apache/metron/common/stellar/StellarTest.java
---
@@ -33,19 +31,66 @@
import org.reflections.Reflections;
import org.reflections.util.ConfigurationBuilder;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
+import java.util.*;
import static org.apache.metron.common.utils.StellarProcessorUtils.run;
import static
org.apache.metron.common.utils.StellarProcessorUtils.runPredicate;
@SuppressWarnings("ALL")
public class StellarTest {
+ @Stellar(
+ description="throw exception",
+ name="THROW",
+ params = {
+ "message - exception message"
+ },
+ returns="nothing"
+ )
+ public static class Throw implements StellarFunction {
+
+ @Override
+ public Object apply(List<Object> args, Context context) throws
ParseException {
+ throw new IllegalStateException(Joiner.on(" ").join(args));
+ }
+
+ @Override
+ public void initialize(Context context) {
+
+ }
+
+ @Override
+ public boolean isInitialized() {
+ return true;
+ }
+ }
+
+ @Stellar(
--- End diff --
Ah yes, will do
> Short circuit operations for Stellar
> ------------------------------------
>
> Key: METRON-980
> URL: https://issues.apache.org/jira/browse/METRON-980
> Project: Metron
> Issue Type: Improvement
> Reporter: Casey Stella
> Assignee: Casey Stella
>
> Stellar does not currently contain short circuit operations. In most
> languages, this is an important optimization, but for Stellar on Metron, this
> is a requirement due to the fact that some variables may be null legitimately
> and we cannot create multi-line conditionals or temporary variables at the
> moment.
> The short circuit operations supported:
> * short circuited `or` (e.g. true or FUNC(...) would never execute FUNC)
> * short circuited `and` (e.g. false and FUNC(...) would never execute FUNC)
> * short circuited if/then/else (e.g. if true then FUNC(...) else FUNC2(...)
> will never call FUNC2)
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)