[GitHub] nifi pull request #1662: NIFI-3688 Extended Groovy Nifi Processor

2017-11-13 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/nifi/pull/1662


---


[GitHub] nifi pull request #1662: NIFI-3688 Extended Groovy Nifi Processor

2017-11-08 Thread mattyb149
Github user mattyb149 commented on a diff in the pull request:

https://github.com/apache/nifi/pull/1662#discussion_r149756860
  
--- Diff: 
nifi-nar-bundles/nifi-groovyx-bundle/nifi-groovyx-processors/src/main/resources/docs/org.apache.nifi.processors.groovyx.ExecuteGroovyScript/additionalDetails.html
 ---
@@ -0,0 +1,202 @@
+
+
+
+
+
+Groovy
+
+
+
+
+
+Summary
+This is a grooviest groovy script :)
+Script Bindings:
+
+variabletypedescription
+
+   session
+   org.apache.nifi.processor.ProcessSession
+   the session that is used to get, change, and transfer input 
files
+
+
+   context
+   org.apache.nifi.processor.ProcessContext
+   the context (almost unusefull)
+
+
+   log
+   org.apache.nifi.logging.ComponentLog
+   the logger for this processor instance
+
+
+   REL_SUCCESS
+   org.apache.nifi.processor.Relationship
+   the success relationship
+
+
+   REL_FAILURE
+   org.apache.nifi.processor.Relationship
+   the failure relationship
+
+
+   flowFile
+   org.apache.nifi.flowfile.FlowFile
+   Binded only if the property `Require flow file`=true for the 
processor
+
+
+   CTL
+   java.util.HashMap
+   Map populated with controller services binded through `CTL.*` 
processor properties
+
+
+   Dynamic processor properties
+   org.apache.nifi.components.PropertyDescriptor
+   All processor properties not started with `CTL.` are binded to 
script variables
+
+
+
+CTL map
+
+CTL.* objects accessible if corresponding processor property defined.
+Example: if you defined property `CTL.cache` to 
DistributedMapCacheClientService, then you can access it from code 
CTL.cache
+If CTL property references to Database connection pool, then corresponding 
CTL entry will contain groovy.sql.Sql object connected to database with 
autocommit=false.
--- End diff --

The version of setAutoCommit() you link to is their master branch. The 
version that ships with NiFi's Hive NAR is 
[here](https://github.com/apache/hive/blob/release-1.2.1/jdbc/src/java/org/apache/hive/jdbc/HiveConnection.java#L1197).
 Strangely, they're handling it backwards from how they do in master.
Just to be safe, it might be better to not explicitly call 
setAutoCommit(false) and maybe instead allow the script writer to call it on 
CTL or the appropriate object?

This is your processor and contribution, so you can choose whether to 
support JDBC connections that don't behave with the calls you're making. Hive 
is just one example, but there might be others that don't implement certain 
methods well or at all. It is totally fine to just say "those aren't 
supported", I'm just bringing it up in case you wanted to address such things. 
Let me know either way and I'll continue the review/merge, thanks!


---


[GitHub] nifi pull request #1662: NIFI-3688 Extended Groovy Nifi Processor

2017-11-05 Thread dlukyanov
Github user dlukyanov commented on a diff in the pull request:

https://github.com/apache/nifi/pull/1662#discussion_r148957155
  
--- Diff: nifi-nar-bundles/pom.xml ---
@@ -94,7 +95,7 @@
 
 
 
-
+

[GitHub] nifi pull request #1662: NIFI-3688 Extended Groovy Nifi Processor

2017-11-05 Thread dlukyanov
Github user dlukyanov commented on a diff in the pull request:

https://github.com/apache/nifi/pull/1662#discussion_r148957134
  
--- Diff: 
nifi-nar-bundles/nifi-groovyx-bundle/nifi-groovyx-processors/src/main/java/org/apache/nifi/processors/groovyx/ExecuteGroovyScript.java
 ---
@@ -0,0 +1,453 @@
+/*
+ * 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.nifi.processors.groovyx;
+
+import java.io.File;
+import java.lang.reflect.Method;
+import java.sql.SQLException;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.nifi.annotation.behavior.Restricted;
+import org.apache.nifi.annotation.behavior.DynamicProperty;
+import org.apache.nifi.annotation.behavior.EventDriven;
+import org.apache.nifi.annotation.behavior.InputRequirement;
+import org.apache.nifi.annotation.documentation.CapabilityDescription;
+import org.apache.nifi.annotation.documentation.SeeAlso;
+import org.apache.nifi.annotation.documentation.Tags;
+import org.apache.nifi.annotation.lifecycle.OnScheduled;
+import org.apache.nifi.annotation.lifecycle.OnStopped;
+import org.apache.nifi.components.PropertyDescriptor;
+import org.apache.nifi.controller.ControllerService;
+import org.apache.nifi.dbcp.DBCPService;
+import org.apache.nifi.flowfile.FlowFile;
--- End diff --

fixed


---


[GitHub] nifi pull request #1662: NIFI-3688 Extended Groovy Nifi Processor

2017-11-05 Thread dlukyanov
Github user dlukyanov commented on a diff in the pull request:

https://github.com/apache/nifi/pull/1662#discussion_r148956693
  
--- Diff: 
nifi-nar-bundles/nifi-groovyx-bundle/nifi-groovyx-processors/src/main/resources/docs/org.apache.nifi.processors.groovyx.ExecuteGroovyScript/additionalDetails.html
 ---
@@ -0,0 +1,202 @@
+
+
+
+
+
+Groovy
+
+
+
+
+
+Summary
+This is a grooviest groovy script :)
+Script Bindings:
+
+variabletypedescription
+
+   session
+   org.apache.nifi.processor.ProcessSession
+   the session that is used to get, change, and transfer input 
files
+
+
+   context
+   org.apache.nifi.processor.ProcessContext
+   the context (almost unusefull)
+
+
+   log
+   org.apache.nifi.logging.ComponentLog
+   the logger for this processor instance
+
+
+   REL_SUCCESS
+   org.apache.nifi.processor.Relationship
+   the success relationship
+
+
+   REL_FAILURE
+   org.apache.nifi.processor.Relationship
+   the failure relationship
+
+
+   flowFile
+   org.apache.nifi.flowfile.FlowFile
+   Binded only if the property `Require flow file`=true for the 
processor
+
+
+   CTL
+   java.util.HashMap
+   Map populated with controller services binded through `CTL.*` 
processor properties
+
+
+   Dynamic processor properties
+   org.apache.nifi.components.PropertyDescriptor
+   All processor properties not started with `CTL.` are binded to 
script variables
+
+
+
+CTL map
+
+CTL.* objects accessible if corresponding processor property defined.
+Example: if you defined property `CTL.cache` to 
DistributedMapCacheClientService, then you can access it from code 
CTL.cache
+If CTL property references to Database connection pool, then corresponding 
CTL entry will contain groovy.sql.Sql object connected to database with 
autocommit=false.
--- End diff --

Here I call `setAutoCommit(false)`: 
[ExecuteGroovyScript.java#L312](https://github.com/dlukyanov/nifi/blob/master/nifi-nar-bundles/nifi-groovyx-bundle/nifi-groovyx-processors/src/main/java/org/apache/nifi/processors/groovyx/ExecuteGroovyScript.java#L312)
 

with hive that's interesting question. according to code 
[HiveConnection.setAutoCommit()](https://github.com/apache/hive/blob/master/jdbc/src/java/org/apache/hive/jdbc/HiveConnection.java#L1338)
 will log warning. but the 
[HiveConnection.commit()](https://github.com/apache/hive/blob/master/jdbc/src/java/org/apache/hive/jdbc/HiveConnection.java#L873)
 will not work in any case. What do you think? Allow `groovy.sql.Sql` to be 
created only for `DBCPService` ? 


---


[GitHub] nifi pull request #1662: NIFI-3688 Extended Groovy Nifi Processor

2017-11-05 Thread dlukyanov
Github user dlukyanov commented on a diff in the pull request:

https://github.com/apache/nifi/pull/1662#discussion_r148955987
  
--- Diff: 
nifi-nar-bundles/nifi-groovyx-bundle/nifi-groovyx-processors/src/main/resources/docs/org.apache.nifi.processors.groovyx.ExecuteGroovyScript/additionalDetails.html
 ---
@@ -0,0 +1,202 @@
+
+
+
+
+
+Groovy
+
+
+
+
+
+Summary
+This is a grooviest groovy script :)
+Script Bindings:
+
+variabletypedescription
+
+   session
+   org.apache.nifi.processor.ProcessSession
+   the session that is used to get, change, and transfer input 
files
+
+
+   context
+   org.apache.nifi.processor.ProcessContext
+   the context (almost unusefull)
+
+
+   log
+   org.apache.nifi.logging.ComponentLog
+   the logger for this processor instance
+
+
+   REL_SUCCESS
+   org.apache.nifi.processor.Relationship
+   the success relationship
+
+
+   REL_FAILURE
+   org.apache.nifi.processor.Relationship
+   the failure relationship
+
+
+   flowFile
+   org.apache.nifi.flowfile.FlowFile
+   Binded only if the property `Require flow file`=true for the 
processor
+
+
+   CTL
+   java.util.HashMap
+   Map populated with controller services binded through `CTL.*` 
processor properties
+
+
+   Dynamic processor properties
+   org.apache.nifi.components.PropertyDescriptor
+   All processor properties not started with `CTL.` are binded to 
script variables
+
+
+
+CTL map
+
+CTL.* objects accessible if corresponding processor property defined.
+Example: if you defined property `CTL.cache` to 
DistributedMapCacheClientService, then you can access it from code 
CTL.cache
--- End diff --

Yes, this adds kind of limit. All custom properties with name beginning 
with `CTL.` automatically supposed to be linked to controller services. It 
means you can't define custom `CTL.*` property with plain string value. After 
`CTL.`there could be any chars. On the level of groovy script the additional 
predefined variable binded : `CTL` - a hashmap with substring after `CTL.` as a 
key and linked controller service as a value. If you defined `CTL.aaa` and 
linked it to distributed cache client service, then on level of groovy it'slike 
`def CTL=[:]` and `CTL['aaa']=LINK_TO_THE_SERVICE`. So, in groovy you can 
access this service  `CTL.aaa.someServiceMethod(...)`

The only conflict expected when you'll try to define custom script variable 
with name `CTL`. Otherwise-no conflicts.


---


[GitHub] nifi pull request #1662: NIFI-3688 Extended Groovy Nifi Processor

2017-11-01 Thread mattyb149
Github user mattyb149 commented on a diff in the pull request:

https://github.com/apache/nifi/pull/1662#discussion_r148413690
  
--- Diff: 
nifi-nar-bundles/nifi-groovyx-bundle/nifi-groovyx-processors/src/main/java/org/apache/nifi/processors/groovyx/ExecuteGroovyScript.java
 ---
@@ -0,0 +1,453 @@
+/*
+ * 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.nifi.processors.groovyx;
+
+import java.io.File;
+import java.lang.reflect.Method;
+import java.sql.SQLException;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.nifi.annotation.behavior.Restricted;
+import org.apache.nifi.annotation.behavior.DynamicProperty;
+import org.apache.nifi.annotation.behavior.EventDriven;
+import org.apache.nifi.annotation.behavior.InputRequirement;
+import org.apache.nifi.annotation.documentation.CapabilityDescription;
+import org.apache.nifi.annotation.documentation.SeeAlso;
+import org.apache.nifi.annotation.documentation.Tags;
+import org.apache.nifi.annotation.lifecycle.OnScheduled;
+import org.apache.nifi.annotation.lifecycle.OnStopped;
+import org.apache.nifi.components.PropertyDescriptor;
+import org.apache.nifi.controller.ControllerService;
+import org.apache.nifi.dbcp.DBCPService;
+import org.apache.nifi.flowfile.FlowFile;
--- End diff --

Checkstyle (via the -Pcontrib-check Maven profile) says this is unused, so 
it should be removed


---


[GitHub] nifi pull request #1662: NIFI-3688 Extended Groovy Nifi Processor

2017-11-01 Thread mattyb149
Github user mattyb149 commented on a diff in the pull request:

https://github.com/apache/nifi/pull/1662#discussion_r148412300
  
--- Diff: 
nifi-nar-bundles/nifi-groovyx-bundle/nifi-groovyx-processors/src/main/resources/docs/org.apache.nifi.processors.groovyx.ExecuteGroovyScript/additionalDetails.html
 ---
@@ -0,0 +1,202 @@
+
+
+
+
+
+Groovy
+
+
+
+
+
+Summary
+This is a grooviest groovy script :)
+Script Bindings:
+
+variabletypedescription
+
+   session
+   org.apache.nifi.processor.ProcessSession
+   the session that is used to get, change, and transfer input 
files
+
+
+   context
+   org.apache.nifi.processor.ProcessContext
+   the context (almost unusefull)
+
+
+   log
+   org.apache.nifi.logging.ComponentLog
+   the logger for this processor instance
+
+
+   REL_SUCCESS
+   org.apache.nifi.processor.Relationship
+   the success relationship
+
+
+   REL_FAILURE
+   org.apache.nifi.processor.Relationship
+   the failure relationship
+
+
+   flowFile
+   org.apache.nifi.flowfile.FlowFile
+   Binded only if the property `Require flow file`=true for the 
processor
+
+
+   CTL
+   java.util.HashMap
+   Map populated with controller services binded through `CTL.*` 
processor properties
+
+
+   Dynamic processor properties
+   org.apache.nifi.components.PropertyDescriptor
+   All processor properties not started with `CTL.` are binded to 
script variables
+
+
+
+CTL map
+
+CTL.* objects accessible if corresponding processor property defined.
+Example: if you defined property `CTL.cache` to 
DistributedMapCacheClientService, then you can access it from code 
CTL.cache
--- End diff --

Can you explain (at least to me here) more about linking with CTL? Does the 
name of the service have to be "cache" in this case? Or does there need to be a 
user-defined property called "CTL.cache" added to the service? If the latter, 
what if the service itself uses the user-defined properties? Seems like there 
might be conflict in processing?


---


[GitHub] nifi pull request #1662: NIFI-3688 Extended Groovy Nifi Processor

2017-11-01 Thread mattyb149
Github user mattyb149 commented on a diff in the pull request:

https://github.com/apache/nifi/pull/1662#discussion_r148412458
  
--- Diff: nifi-nar-bundles/pom.xml ---
@@ -94,7 +95,7 @@
 
 
 
-
+

[GitHub] nifi pull request #1662: NIFI-3688 Extended Groovy Nifi Processor

2017-11-01 Thread mattyb149
Github user mattyb149 commented on a diff in the pull request:

https://github.com/apache/nifi/pull/1662#discussion_r148412024
  
--- Diff: 
nifi-nar-bundles/nifi-groovyx-bundle/nifi-groovyx-processors/src/main/resources/docs/org.apache.nifi.processors.groovyx.ExecuteGroovyScript/additionalDetails.html
 ---
@@ -0,0 +1,202 @@
+
+
+
+
+
+Groovy
+
+
+
+
+
+Summary
+This is a grooviest groovy script :)
+Script Bindings:
+
+variabletypedescription
+
+   session
+   org.apache.nifi.processor.ProcessSession
+   the session that is used to get, change, and transfer input 
files
+
+
+   context
+   org.apache.nifi.processor.ProcessContext
+   the context (almost unusefull)
+
+
+   log
+   org.apache.nifi.logging.ComponentLog
+   the logger for this processor instance
+
+
+   REL_SUCCESS
+   org.apache.nifi.processor.Relationship
+   the success relationship
+
+
+   REL_FAILURE
+   org.apache.nifi.processor.Relationship
+   the failure relationship
+
+
+   flowFile
+   org.apache.nifi.flowfile.FlowFile
+   Binded only if the property `Require flow file`=true for the 
processor
+
+
+   CTL
+   java.util.HashMap
+   Map populated with controller services binded through `CTL.*` 
processor properties
+
+
+   Dynamic processor properties
+   org.apache.nifi.components.PropertyDescriptor
+   All processor properties not started with `CTL.` are binded to 
script variables
+
+
+
+CTL map
+
+CTL.* objects accessible if corresponding processor property defined.
+Example: if you defined property `CTL.cache` to 
DistributedMapCacheClientService, then you can access it from code 
CTL.cache
+If CTL property references to Database connection pool, then corresponding 
CTL entry will contain groovy.sql.Sql object connected to database with 
autocommit=false.
+CTL - Database transactions automatically rolled back on script exception 
and committed on success. Script must not disconnect connection.
+
+
+
+
+SessionFile - flow file extension
+
+  The (org.apache.nifi.processors.groovyx.flow.SessionFile) is an actual 
object returned by session in Extended Groovy processor.
+  This flow file is a container that references session and the real flow 
file.
+  This allows to use simplified syntax to work with file attributes and 
content:
+
+set new attribute value
+
+  flowFile.ATTRIBUTE_NAME = ATTRIBUTE_VALUE 
--- End diff --

These features are awesome!


---


[GitHub] nifi pull request #1662: NIFI-3688 Extended Groovy Nifi Processor

2017-11-01 Thread mattyb149
Github user mattyb149 commented on a diff in the pull request:

https://github.com/apache/nifi/pull/1662#discussion_r148411913
  
--- Diff: 
nifi-nar-bundles/nifi-groovyx-bundle/nifi-groovyx-processors/src/main/resources/docs/org.apache.nifi.processors.groovyx.ExecuteGroovyScript/additionalDetails.html
 ---
@@ -0,0 +1,202 @@
+
+
+
+
+
+Groovy
+
+
+
+
+
+Summary
+This is a grooviest groovy script :)
+Script Bindings:
+
+variabletypedescription
+
+   session
+   org.apache.nifi.processor.ProcessSession
+   the session that is used to get, change, and transfer input 
files
+
+
+   context
+   org.apache.nifi.processor.ProcessContext
+   the context (almost unusefull)
+
+
+   log
+   org.apache.nifi.logging.ComponentLog
+   the logger for this processor instance
+
+
+   REL_SUCCESS
+   org.apache.nifi.processor.Relationship
+   the success relationship
+
+
+   REL_FAILURE
+   org.apache.nifi.processor.Relationship
+   the failure relationship
+
+
+   flowFile
+   org.apache.nifi.flowfile.FlowFile
+   Binded only if the property `Require flow file`=true for the 
processor
+
+
+   CTL
+   java.util.HashMap
+   Map populated with controller services binded through `CTL.*` 
processor properties
+
+
+   Dynamic processor properties
+   org.apache.nifi.components.PropertyDescriptor
+   All processor properties not started with `CTL.` are binded to 
script variables
+
+
+
+CTL map
+
+CTL.* objects accessible if corresponding processor property defined.
+Example: if you defined property `CTL.cache` to 
DistributedMapCacheClientService, then you can access it from code 
CTL.cache
+If CTL property references to Database connection pool, then corresponding 
CTL entry will contain groovy.sql.Sql object connected to database with 
autocommit=false.
--- End diff --

How is it guaranteed that autocommit will be false? If setAutoCommit is 
called somewhere (either by your code -- which I couldn't find a reference to 
-- or by groovy's Sql class), it can cause problems in a couple of scenarios, 
one being Oracle if the DBA has disallowed changing auto-commit, and another is 
Hive (since HiveConnectionPool extends DBCPService, it should be available via 
CTL right?)


---


[GitHub] nifi pull request #1662: NIFI-3688 Extended Groovy Nifi Processor

2017-10-11 Thread mattyb149
Github user mattyb149 commented on a diff in the pull request:

https://github.com/apache/nifi/pull/1662#discussion_r144080861
  
--- Diff: nifi-nar-bundles/nifi-groovyx-bundle/nifi-groovyx-nar/pom.xml ---
@@ -0,0 +1,44 @@
+
+
+http://maven.apache.org/POM/4.0.0; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance; 
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd;>
+4.0.0
+
+
+org.apache.nifi
+nifi-groovyx-bundle
+1.4.0-SNAPSHOT
--- End diff --

Sorry I keep losing track of this PR :(  In the meantime we have released 
1.4.0, do you mind changing these references to 1.5.0-SNAPSHOT and rebasing 
against the latest master? Please and thanks!


---


[GitHub] nifi pull request #1662: NIFI-3688 Extended Groovy Nifi Processor

2017-06-27 Thread dlukyanov
Github user dlukyanov commented on a diff in the pull request:

https://github.com/apache/nifi/pull/1662#discussion_r124206087
  
--- Diff: 
nifi-nar-bundles/nifi-groovyx-bundle/nifi-groovyx-processors/src/main/java/org/apache/nifi/processors/groovyx/GroovyMethods.java
 ---
@@ -0,0 +1,85 @@
+/*
+ * 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.nifi.processors.groovyx;
+
+import groovy.lang.DelegatingMetaClass;
+import groovy.lang.GroovySystem;
+
+import org.apache.nifi.processors.groovyx.flow.ProcessSessionWrap;
+import org.apache.nifi.processors.groovyx.flow.SessionFile;
+
+import org.apache.nifi.processor.Relationship;
+import org.apache.nifi.flowfile.FlowFile;
+
+import java.util.Collection;
+import java.util.List;
+
+/**
+ * Class to initialize additional groovy methods to work with SessionFile, 
Relationship, and Sessions easier
+ */
+class GroovyMethods {
+private static boolean initialized = false;
+
+static void init() {
+if (!initialized) {
+synchronized (GroovyMethods.class) {
+if (!initialized) {
+initialized = metaRelationship();
+}
+}
+}
+}
+
+private static boolean metaRelationship() {
+
GroovySystem.getMetaClassRegistry().setMetaClass(Relationship.class, new 
DelegatingMetaClass(Relationship.class) {
+@Override
+public Object invokeMethod(Object object, String methodName, 
Object[] args) {
+if (object instanceof Relationship) {
+if ("leftShift".equals(methodName) && args.length == 
1) {
+if (args[0] instanceof SessionFile) {
+return this.leftShift((Relationship) object, 
(SessionFile) args[0]);
+} else if (args[0] instanceof Collection) {
+return this.leftShift((Relationship) object, 
(Collection) args[0]);
+}
+}
+}
+return super.invokeMethod(object, methodName, args);
+}
+
+/** to support: REL_SUCCESS << sessionFile */
+private Relationship leftShift(Relationship r, SessionFile f) {
--- End diff --

btw. leftshift allows syntax: 
`REL_SUCCESS << a << b << c`


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] nifi pull request #1662: NIFI-3688 Extended Groovy Nifi Processor

2017-06-27 Thread dlukyanov
Github user dlukyanov commented on a diff in the pull request:

https://github.com/apache/nifi/pull/1662#discussion_r124205062
  
--- Diff: 
nifi-nar-bundles/nifi-groovyx-bundle/nifi-groovyx-processors/src/main/java/org/apache/nifi/processors/groovyx/ExecuteGroovyScript.java
 ---
@@ -0,0 +1,468 @@
+/*
+ * 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.nifi.processors.groovyx;
+
+import java.io.File;
+import java.lang.reflect.Method;
+import java.sql.SQLException;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.nifi.annotation.behavior.Restricted;
+import org.apache.nifi.annotation.behavior.DynamicProperty;
+import org.apache.nifi.annotation.behavior.EventDriven;
+import org.apache.nifi.annotation.documentation.CapabilityDescription;
+import org.apache.nifi.annotation.documentation.SeeAlso;
+import org.apache.nifi.annotation.documentation.Tags;
+import org.apache.nifi.annotation.lifecycle.OnScheduled;
+import org.apache.nifi.annotation.lifecycle.OnStopped;
+import org.apache.nifi.components.PropertyDescriptor;
+import org.apache.nifi.controller.ControllerService;
+import org.apache.nifi.dbcp.DBCPService;
+import org.apache.nifi.flowfile.FlowFile;
+import org.apache.nifi.processor.AbstractProcessor;
+import org.apache.nifi.processor.ProcessContext;
+import org.apache.nifi.processor.ProcessSession;
+import org.apache.nifi.processor.ProcessorInitializationContext;
+import org.apache.nifi.processor.Relationship;
+import org.apache.nifi.processor.exception.ProcessException;
+import org.apache.nifi.processor.util.StandardValidators;
+import org.codehaus.groovy.control.CompilerConfiguration;
+import org.codehaus.groovy.runtime.ResourceGroovyMethods;
+import org.codehaus.groovy.runtime.StackTraceUtils;
+
+import org.apache.nifi.processors.groovyx.sql.OSql;
+import org.apache.nifi.processors.groovyx.util.Files;
+import org.apache.nifi.processors.groovyx.util.Validators;
+import org.apache.nifi.processors.groovyx.flow.GroovyProcessSessionWrap;
+
+import groovy.lang.GroovyShell;
+import groovy.lang.Script;
+
+import org.apache.nifi.components.ValidationResult;
+import org.apache.nifi.components.ValidationContext;
+
+@EventDriven
+@Tags({"script", "groovy", "groovyx"})
+@CapabilityDescription(
+"Experimental Extended Groovy script processor. The script is 
responsible for "
++ "handling the incoming flow file (transfer to SUCCESS or remove, 
e.g.) as well as any flow files created by "
++ "the script. If the handling is incomplete or incorrect, the 
session will be rolled back.")
+@Restricted("Provides operator the ability to execute arbitrary code 
assuming all permissions that NiFi has.")
+@SeeAlso({})
--- End diff --

ok. it's just a copy-paste from somewhere)


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] nifi pull request #1662: NIFI-3688 Extended Groovy Nifi Processor

2017-06-27 Thread dlukyanov
Github user dlukyanov commented on a diff in the pull request:

https://github.com/apache/nifi/pull/1662#discussion_r124194297
  
--- Diff: 
nifi-nar-bundles/nifi-groovyx-bundle/nifi-groovyx-processors/src/main/java/org/apache/nifi/processors/groovyx/GroovyMethods.java
 ---
@@ -0,0 +1,85 @@
+/*
+ * 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.nifi.processors.groovyx;
+
+import groovy.lang.DelegatingMetaClass;
+import groovy.lang.GroovySystem;
+
+import org.apache.nifi.processors.groovyx.flow.ProcessSessionWrap;
+import org.apache.nifi.processors.groovyx.flow.SessionFile;
+
+import org.apache.nifi.processor.Relationship;
+import org.apache.nifi.flowfile.FlowFile;
+
+import java.util.Collection;
+import java.util.List;
+
+/**
+ * Class to initialize additional groovy methods to work with SessionFile, 
Relationship, and Sessions easier
+ */
+class GroovyMethods {
+private static boolean initialized = false;
+
+static void init() {
+if (!initialized) {
+synchronized (GroovyMethods.class) {
+if (!initialized) {
+initialized = metaRelationship();
+}
+}
+}
+}
+
+private static boolean metaRelationship() {
+
GroovySystem.getMetaClassRegistry().setMetaClass(Relationship.class, new 
DelegatingMetaClass(Relationship.class) {
+@Override
+public Object invokeMethod(Object object, String methodName, 
Object[] args) {
+if (object instanceof Relationship) {
+if ("leftShift".equals(methodName) && args.length == 
1) {
+if (args[0] instanceof SessionFile) {
+return this.leftShift((Relationship) object, 
(SessionFile) args[0]);
+} else if (args[0] instanceof Collection) {
+return this.leftShift((Relationship) object, 
(Collection) args[0]);
+}
+}
+}
+return super.invokeMethod(object, methodName, args);
+}
+
+/** to support: REL_SUCCESS << sessionFile */
+private Relationship leftShift(Relationship r, SessionFile f) {
--- End diff --

we can do both. at the beginning i did rightShift (more logical when 
coding). then i looked at 
http://docs.groovy-lang.org/latest/html/groovy-jdk/java/io/OutputStream.html 
and it implements only leftShift, so i decided to use leftShift. but i like 
rightShift also)


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] nifi pull request #1662: NIFI-3688 Extended Groovy Nifi Processor

2017-06-26 Thread mattyb149
Github user mattyb149 commented on a diff in the pull request:

https://github.com/apache/nifi/pull/1662#discussion_r124117117
  
--- Diff: 
nifi-nar-bundles/nifi-groovyx-bundle/nifi-groovyx-processors/src/main/java/org/apache/nifi/processors/groovyx/ExecuteGroovyScript.java
 ---
@@ -0,0 +1,468 @@
+/*
+ * 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.nifi.processors.groovyx;
+
+import java.io.File;
+import java.lang.reflect.Method;
+import java.sql.SQLException;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.nifi.annotation.behavior.Restricted;
+import org.apache.nifi.annotation.behavior.DynamicProperty;
+import org.apache.nifi.annotation.behavior.EventDriven;
+import org.apache.nifi.annotation.documentation.CapabilityDescription;
+import org.apache.nifi.annotation.documentation.SeeAlso;
+import org.apache.nifi.annotation.documentation.Tags;
+import org.apache.nifi.annotation.lifecycle.OnScheduled;
+import org.apache.nifi.annotation.lifecycle.OnStopped;
+import org.apache.nifi.components.PropertyDescriptor;
+import org.apache.nifi.controller.ControllerService;
+import org.apache.nifi.dbcp.DBCPService;
+import org.apache.nifi.flowfile.FlowFile;
+import org.apache.nifi.processor.AbstractProcessor;
+import org.apache.nifi.processor.ProcessContext;
+import org.apache.nifi.processor.ProcessSession;
+import org.apache.nifi.processor.ProcessorInitializationContext;
+import org.apache.nifi.processor.Relationship;
+import org.apache.nifi.processor.exception.ProcessException;
+import org.apache.nifi.processor.util.StandardValidators;
+import org.codehaus.groovy.control.CompilerConfiguration;
+import org.codehaus.groovy.runtime.ResourceGroovyMethods;
+import org.codehaus.groovy.runtime.StackTraceUtils;
+
+import org.apache.nifi.processors.groovyx.sql.OSql;
+import org.apache.nifi.processors.groovyx.util.Files;
+import org.apache.nifi.processors.groovyx.util.Validators;
+import org.apache.nifi.processors.groovyx.flow.GroovyProcessSessionWrap;
+
+import groovy.lang.GroovyShell;
+import groovy.lang.Script;
+
+import org.apache.nifi.components.ValidationResult;
+import org.apache.nifi.components.ValidationContext;
+
+@EventDriven
+@Tags({"script", "groovy", "groovyx"})
+@CapabilityDescription(
+"Experimental Extended Groovy script processor. The script is 
responsible for "
++ "handling the incoming flow file (transfer to SUCCESS or remove, 
e.g.) as well as any flow files created by "
++ "the script. If the handling is incomplete or incorrect, the 
session will be rolled back.")
+@Restricted("Provides operator the ability to execute arbitrary code 
assuming all permissions that NiFi has.")
+@SeeAlso({})
--- End diff --

If you are not referring to other processors/classes, you can remove the 
SeeAlso annotation. Alternatively if you want to refer to a processor in 
another NAR (such as ExecuteScript), you could do the following:

`@SeeAlso({classNames="org.apache.nifi.processors.script.ExecuteScript"})`



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] nifi pull request #1662: NIFI-3688 Extended Groovy Nifi Processor

2017-06-26 Thread mattyb149
Github user mattyb149 commented on a diff in the pull request:

https://github.com/apache/nifi/pull/1662#discussion_r124126084
  
--- Diff: 
nifi-nar-bundles/nifi-groovyx-bundle/nifi-groovyx-processors/src/main/java/org/apache/nifi/processors/groovyx/GroovyMethods.java
 ---
@@ -0,0 +1,85 @@
+/*
+ * 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.nifi.processors.groovyx;
+
+import groovy.lang.DelegatingMetaClass;
+import groovy.lang.GroovySystem;
+
+import org.apache.nifi.processors.groovyx.flow.ProcessSessionWrap;
+import org.apache.nifi.processors.groovyx.flow.SessionFile;
+
+import org.apache.nifi.processor.Relationship;
+import org.apache.nifi.flowfile.FlowFile;
+
+import java.util.Collection;
+import java.util.List;
+
+/**
+ * Class to initialize additional groovy methods to work with SessionFile, 
Relationship, and Sessions easier
+ */
+class GroovyMethods {
+private static boolean initialized = false;
+
+static void init() {
+if (!initialized) {
+synchronized (GroovyMethods.class) {
+if (!initialized) {
+initialized = metaRelationship();
+}
+}
+}
+}
+
+private static boolean metaRelationship() {
+
GroovySystem.getMetaClassRegistry().setMetaClass(Relationship.class, new 
DelegatingMetaClass(Relationship.class) {
+@Override
+public Object invokeMethod(Object object, String methodName, 
Object[] args) {
+if (object instanceof Relationship) {
+if ("leftShift".equals(methodName) && args.length == 
1) {
+if (args[0] instanceof SessionFile) {
+return this.leftShift((Relationship) object, 
(SessionFile) args[0]);
+} else if (args[0] instanceof Collection) {
+return this.leftShift((Relationship) object, 
(Collection) args[0]);
+}
+}
+}
+return super.invokeMethod(object, methodName, args);
+}
+
+/** to support: REL_SUCCESS << sessionFile */
+private Relationship leftShift(Relationship r, SessionFile f) {
--- End diff --

These are great!  Should we support right-shift too?

`sessionFile >> REL_SUCCESS`

If having both is too confusing, then this one will work just fine!


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] nifi pull request #1662: NIFI-3688 Extended Groovy Nifi Processor

2017-06-26 Thread mattyb149
Github user mattyb149 commented on a diff in the pull request:

https://github.com/apache/nifi/pull/1662#discussion_r124125472
  
--- Diff: 
nifi-nar-bundles/nifi-groovyx-bundle/nifi-groovyx-processors/src/main/java/org/apache/nifi/processors/groovyx/ExecuteGroovyScript.java
 ---
@@ -0,0 +1,468 @@
+/*
+ * 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.nifi.processors.groovyx;
+
+import java.io.File;
+import java.lang.reflect.Method;
+import java.sql.SQLException;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.nifi.annotation.behavior.Restricted;
+import org.apache.nifi.annotation.behavior.DynamicProperty;
+import org.apache.nifi.annotation.behavior.EventDriven;
+import org.apache.nifi.annotation.documentation.CapabilityDescription;
+import org.apache.nifi.annotation.documentation.SeeAlso;
+import org.apache.nifi.annotation.documentation.Tags;
+import org.apache.nifi.annotation.lifecycle.OnScheduled;
+import org.apache.nifi.annotation.lifecycle.OnStopped;
+import org.apache.nifi.components.PropertyDescriptor;
+import org.apache.nifi.controller.ControllerService;
+import org.apache.nifi.dbcp.DBCPService;
+import org.apache.nifi.flowfile.FlowFile;
+import org.apache.nifi.processor.AbstractProcessor;
+import org.apache.nifi.processor.ProcessContext;
+import org.apache.nifi.processor.ProcessSession;
+import org.apache.nifi.processor.ProcessorInitializationContext;
+import org.apache.nifi.processor.Relationship;
+import org.apache.nifi.processor.exception.ProcessException;
+import org.apache.nifi.processor.util.StandardValidators;
+import org.codehaus.groovy.control.CompilerConfiguration;
+import org.codehaus.groovy.runtime.ResourceGroovyMethods;
+import org.codehaus.groovy.runtime.StackTraceUtils;
+
+import org.apache.nifi.processors.groovyx.sql.OSql;
+import org.apache.nifi.processors.groovyx.util.Files;
+import org.apache.nifi.processors.groovyx.util.Validators;
+import org.apache.nifi.processors.groovyx.flow.GroovyProcessSessionWrap;
+
+import groovy.lang.GroovyShell;
+import groovy.lang.Script;
+
+import org.apache.nifi.components.ValidationResult;
+import org.apache.nifi.components.ValidationContext;
+
+@EventDriven
--- End diff --

You might want an InputRequirement annotation here, just for clarity. The 
processor will default to INPUT_ALLOWED which I think is what you want, but it 
would probably help here, especially in the context of your REQUIRE_FLOW 
property below


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] nifi pull request #1662: NIFI-3688 Extended Groovy Nifi Processor

2017-06-26 Thread mattyb149
Github user mattyb149 commented on a diff in the pull request:

https://github.com/apache/nifi/pull/1662#discussion_r124124963
  
--- Diff: 
nifi-nar-bundles/nifi-groovyx-bundle/nifi-groovyx-processors/src/main/java/org/apache/nifi/processors/groovyx/ExecuteGroovyScript.java
 ---
@@ -0,0 +1,468 @@
+/*
+ * 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.nifi.processors.groovyx;
+
+import java.io.File;
+import java.lang.reflect.Method;
+import java.sql.SQLException;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.nifi.annotation.behavior.Restricted;
+import org.apache.nifi.annotation.behavior.DynamicProperty;
+import org.apache.nifi.annotation.behavior.EventDriven;
+import org.apache.nifi.annotation.documentation.CapabilityDescription;
+import org.apache.nifi.annotation.documentation.SeeAlso;
+import org.apache.nifi.annotation.documentation.Tags;
+import org.apache.nifi.annotation.lifecycle.OnScheduled;
+import org.apache.nifi.annotation.lifecycle.OnStopped;
+import org.apache.nifi.components.PropertyDescriptor;
+import org.apache.nifi.controller.ControllerService;
+import org.apache.nifi.dbcp.DBCPService;
+import org.apache.nifi.flowfile.FlowFile;
+import org.apache.nifi.processor.AbstractProcessor;
+import org.apache.nifi.processor.ProcessContext;
+import org.apache.nifi.processor.ProcessSession;
+import org.apache.nifi.processor.ProcessorInitializationContext;
+import org.apache.nifi.processor.Relationship;
+import org.apache.nifi.processor.exception.ProcessException;
+import org.apache.nifi.processor.util.StandardValidators;
+import org.codehaus.groovy.control.CompilerConfiguration;
+import org.codehaus.groovy.runtime.ResourceGroovyMethods;
+import org.codehaus.groovy.runtime.StackTraceUtils;
+
+import org.apache.nifi.processors.groovyx.sql.OSql;
+import org.apache.nifi.processors.groovyx.util.Files;
+import org.apache.nifi.processors.groovyx.util.Validators;
+import org.apache.nifi.processors.groovyx.flow.GroovyProcessSessionWrap;
+
+import groovy.lang.GroovyShell;
+import groovy.lang.Script;
+
+import org.apache.nifi.components.ValidationResult;
+import org.apache.nifi.components.ValidationContext;
+
+@EventDriven
+@Tags({"script", "groovy", "groovyx"})
+@CapabilityDescription(
+"Experimental Extended Groovy script processor. The script is 
responsible for "
++ "handling the incoming flow file (transfer to SUCCESS or remove, 
e.g.) as well as any flow files created by "
++ "the script. If the handling is incomplete or incorrect, the 
session will be rolled back.")
+@Restricted("Provides operator the ability to execute arbitrary code 
assuming all permissions that NiFi has.")
+@SeeAlso({})
+@DynamicProperty(name = "A script engine property to update",
+value = "The value to set it to",
+supportsExpressionLanguage = true,
+description = "Updates a script engine property specified by the 
Dynamic Property's key with the value "
++ "specified by the Dynamic Property's value. Use `CTL.` 
to access any controller services.")
+public class ExecuteGroovyScript extends AbstractProcessor {
+public static final String GROOVY_CLASSPATH = "${groovy.classes.path}";
+
+private static final String PRELOADS = "import 
org.apache.nifi.components.*;" + "import org.apache.nifi.flowfile.FlowFile;" + 
"import org.apache.nifi.processor.*;"
++ "import 
org.apache.nifi.processor.FlowFileFilter.FlowFileFilterResult;" + "import 
org.apache.nifi.processor.exception.*;" + "import 
org.apache.nifi.processor.io.*;"
++ "import org.apache.nifi.processor.util.*;" + "import 
org.apache.nifi.processors.script.*;" + "import 

[GitHub] nifi pull request #1662: NIFI-3688 Extended Groovy Nifi Processor

2017-06-26 Thread mattyb149
Github user mattyb149 commented on a diff in the pull request:

https://github.com/apache/nifi/pull/1662#discussion_r124116427
  
--- Diff: 
nifi-nar-bundles/nifi-groovyx-bundle/nifi-groovyx-processors/pom.xml ---
@@ -0,0 +1,76 @@
+
+
+http://maven.apache.org/POM/4.0.0; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance; 
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd;>
+4.0.0
+
+
+org.apache.nifi
+nifi-groovyx-bundle
+1.4.0-SNAPSHOT
+
+
+nifi-groovyx-processors
+jar
+
+
+
+org.apache.nifi
+nifi-api
+provided
+
+
+org.apache.nifi
+nifi-processor-utils
+provided
+
+
+org.codehaus.groovy
+groovy-all
+2.4.11
+
--- End diff --

This unused line can be removed


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] nifi pull request #1662: NIFI-3688 Extended Groovy Nifi Processor

2017-06-26 Thread mattyb149
Github user mattyb149 commented on a diff in the pull request:

https://github.com/apache/nifi/pull/1662#discussion_r124113688
  
--- Diff: nifi-nar-bundles/nifi-groovyx-bundle/nifi-groovyx-nar/pom.xml ---
@@ -0,0 +1,44 @@
+
+
+http://maven.apache.org/POM/4.0.0; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance; 
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd;>
+4.0.0
+
+
+org.apache.nifi
+nifi-groovyx-bundle
+1.2.0-SNAPSHOT
+
+
+nifi-groovyx-nar
+nar
+
+true
--- End diff --

I think for the NAR POM this is fine, there should be no Javadoc generated 
for the NAR itself. This is a pretty standard pattern for NARs, I'm guessing 
you got it from the scripting NAR's POM :)


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] nifi pull request #1662: NIFI-3688 Extended Groovy Nifi Processor

2017-05-15 Thread dlukyanov
Github user dlukyanov commented on a diff in the pull request:

https://github.com/apache/nifi/pull/1662#discussion_r116540624
  
--- Diff: nifi-nar-bundles/nifi-groovyx-bundle/nifi-groovyx-nar/pom.xml ---
@@ -0,0 +1,44 @@
+
+
+http://maven.apache.org/POM/4.0.0; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance; 
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd;>
+4.0.0
+
+
+org.apache.nifi
+nifi-groovyx-bundle
+1.2.0-SNAPSHOT
--- End diff --

Great! I'll do it this weekend.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] nifi pull request #1662: NIFI-3688 Extended Groovy Nifi Processor

2017-05-02 Thread mattyb149
Github user mattyb149 commented on a diff in the pull request:

https://github.com/apache/nifi/pull/1662#discussion_r114323960
  
--- Diff: 
nifi-nar-bundles/nifi-groovyx-bundle/nifi-groovyx-processors/src/main/java/org/apache/nifi/processors/groovyx/ExecuteGroovyScript.java
 ---
@@ -0,0 +1,461 @@
+/*
+ * 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.nifi.processors.groovyx;
+
+import java.io.File;
+import java.lang.reflect.Method;
+import java.sql.SQLException;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.nifi.annotation.behavior.DynamicProperty;
+import org.apache.nifi.annotation.behavior.EventDriven;
+import org.apache.nifi.annotation.documentation.CapabilityDescription;
+import org.apache.nifi.annotation.documentation.SeeAlso;
+import org.apache.nifi.annotation.documentation.Tags;
+import org.apache.nifi.annotation.lifecycle.OnScheduled;
+import org.apache.nifi.annotation.lifecycle.OnStopped;
+import org.apache.nifi.components.PropertyDescriptor;
+import org.apache.nifi.controller.ControllerService;
+import org.apache.nifi.dbcp.DBCPService;
+import org.apache.nifi.flowfile.FlowFile;
+import org.apache.nifi.processor.AbstractProcessor;
+import org.apache.nifi.processor.ProcessContext;
+import org.apache.nifi.processor.ProcessSession;
+import org.apache.nifi.processor.ProcessorInitializationContext;
+import org.apache.nifi.processor.Relationship;
+import org.apache.nifi.processor.exception.ProcessException;
+import org.apache.nifi.processor.util.StandardValidators;
+import org.codehaus.groovy.control.CompilerConfiguration;
+import org.codehaus.groovy.runtime.ResourceGroovyMethods;
+import org.codehaus.groovy.runtime.StackTraceUtils;
+
+import org.apache.nifi.processors.groovyx.sql.OSql;
+import org.apache.nifi.processors.groovyx.util.Files;
+import org.apache.nifi.processors.groovyx.util.Validators;
+import org.apache.nifi.processors.groovyx.flow.GroovyProcessSessionWrap;
+
+import groovy.lang.GroovyShell;
+import groovy.lang.Script;
+import groovy.sql.Sql;
+
+import org.apache.nifi.components.ValidationResult;
+import org.apache.nifi.components.Validator;
+import org.apache.nifi.components.ValidationContext;
+
+@EventDriven
+@Tags({"script", "groovy", "groovyx", "extended"})
--- End diff --

I'm not sure that users will search "extended" looking for this processor, 
perhaps this tag is not needed?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] nifi pull request #1662: NIFI-3688 Extended Groovy Nifi Processor

2017-05-02 Thread mattyb149
Github user mattyb149 commented on a diff in the pull request:

https://github.com/apache/nifi/pull/1662#discussion_r114324386
  
--- Diff: 
nifi-nar-bundles/nifi-groovyx-bundle/nifi-groovyx-processors/src/main/java/org/apache/nifi/processors/groovyx/flow/GroovySessionFile.java
 ---
@@ -0,0 +1,284 @@
+/*
+ * 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.nifi.processors.groovyx.flow;
+
+import org.apache.nifi.flowfile.FlowFile;
+import org.apache.nifi.processor.io.OutputStreamCallback;
+import org.apache.nifi.processor.io.StreamCallback;
+import org.apache.nifi.processor.io.InputStreamCallback;
+
+import groovy.lang.Writable;
+import groovy.lang.Closure;
+import groovy.lang.MetaClass;
+import groovy.lang.GroovyObject;
+import org.codehaus.groovy.runtime.InvokerHelper;
+
+
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.OutputStream;
+import java.io.IOException;
+import java.io.OutputStreamWriter;
+import java.io.Writer;
+
+/**
+ * SessionFile with groovy specific methods.
+ */
+public class GroovySessionFile extends SessionFile implements GroovyObject 
{
+private transient MetaClass metaClass;
+
+protected GroovySessionFile(ProcessSessionWrap session, FlowFile f) {
+super(session, f);
+setMetaClass(null); //set defult metaclass
--- End diff --

Minor typo here (default vs defult)


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] nifi pull request #1662: NIFI-3688 Extended Groovy Nifi Processor

2017-05-02 Thread mattyb149
Github user mattyb149 commented on a diff in the pull request:

https://github.com/apache/nifi/pull/1662#discussion_r114324101
  
--- Diff: 
nifi-nar-bundles/nifi-groovyx-bundle/nifi-groovyx-processors/src/main/java/org/apache/nifi/processors/groovyx/ExecuteGroovyScript.java
 ---
@@ -0,0 +1,461 @@
+/*
+ * 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.nifi.processors.groovyx;
+
+import java.io.File;
+import java.lang.reflect.Method;
+import java.sql.SQLException;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.nifi.annotation.behavior.DynamicProperty;
+import org.apache.nifi.annotation.behavior.EventDriven;
+import org.apache.nifi.annotation.documentation.CapabilityDescription;
+import org.apache.nifi.annotation.documentation.SeeAlso;
+import org.apache.nifi.annotation.documentation.Tags;
+import org.apache.nifi.annotation.lifecycle.OnScheduled;
+import org.apache.nifi.annotation.lifecycle.OnStopped;
+import org.apache.nifi.components.PropertyDescriptor;
+import org.apache.nifi.controller.ControllerService;
+import org.apache.nifi.dbcp.DBCPService;
+import org.apache.nifi.flowfile.FlowFile;
+import org.apache.nifi.processor.AbstractProcessor;
+import org.apache.nifi.processor.ProcessContext;
+import org.apache.nifi.processor.ProcessSession;
+import org.apache.nifi.processor.ProcessorInitializationContext;
+import org.apache.nifi.processor.Relationship;
+import org.apache.nifi.processor.exception.ProcessException;
+import org.apache.nifi.processor.util.StandardValidators;
+import org.codehaus.groovy.control.CompilerConfiguration;
+import org.codehaus.groovy.runtime.ResourceGroovyMethods;
+import org.codehaus.groovy.runtime.StackTraceUtils;
+
+import org.apache.nifi.processors.groovyx.sql.OSql;
+import org.apache.nifi.processors.groovyx.util.Files;
+import org.apache.nifi.processors.groovyx.util.Validators;
+import org.apache.nifi.processors.groovyx.flow.GroovyProcessSessionWrap;
+
+import groovy.lang.GroovyShell;
+import groovy.lang.Script;
+import groovy.sql.Sql;
+
+import org.apache.nifi.components.ValidationResult;
+import org.apache.nifi.components.Validator;
+import org.apache.nifi.components.ValidationContext;
+
+@EventDriven
+@Tags({"script", "groovy", "groovyx", "extended"})
+@CapabilityDescription(
+"Experimental Extended Groovy script processor. The script is 
responsible for " + "handling the incoming flow file (transfer to SUCCESS or 
remove, e.g.) as well as any flow files created by "
++ "the script. If the handling is incomplete or incorrect, 
the session will be rolled back.")
+@SeeAlso({})
--- End diff --

This is not needed, recommend removal


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] nifi pull request #1662: NIFI-3688 Extended Groovy Nifi Processor

2017-05-02 Thread mattyb149
Github user mattyb149 commented on a diff in the pull request:

https://github.com/apache/nifi/pull/1662#discussion_r114323810
  
--- Diff: 
nifi-nar-bundles/nifi-groovyx-bundle/nifi-groovyx-processors/pom.xml ---
@@ -0,0 +1,74 @@
+
+
+http://maven.apache.org/POM/4.0.0; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance; 
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd;>
+4.0.0
+
+
+org.apache.nifi
+nifi-groovyx-bundle
+1.2.0-SNAPSHOT
+
+
+nifi-groovyx-processors
+jar
+
+
+
+org.apache.nifi
+nifi-api
+
+
+org.apache.nifi
+nifi-processor-utils
+
+
+org.codehaus.groovy
+groovy-all
+2.4.7
--- End diff --

I believe 2.4.11 has been released, it is not required that you upgrade it 
here, just mentioning it :)


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] nifi pull request #1662: NIFI-3688 Extended Groovy Nifi Processor

2017-04-15 Thread dlukyanov
Github user dlukyanov commented on a diff in the pull request:

https://github.com/apache/nifi/pull/1662#discussion_r111661969
  
--- Diff: 
nifi-nar-bundles/nifi-groovyx-bundle/nifi-groovyx-nar/src/main/resources/META-INF/NOTICE
 ---
@@ -0,0 +1,123 @@
+nifi-groovyx-nar
+Copyright 2014-2017 The Apache Software Foundation
+
+This product includes software developed at
+The Apache Software Foundation (http://www.apache.org/).
+
+**
+Apache Software License v2
+**
+
+The following binary components are provided under the Apache Software 
License v2
+
+  (ASLv2) Apache Commons IO
+The following NOTICE information applies:
+  Apache Commons IO
+  Copyright 2002-2016 The Apache Software Foundation
+
+  (ASLv2) Apache Commons Email
+The following NOTICE information applies:
+  Apache Commons Email
+  Copyright 2002-2016 The Apache Software Foundation
+
+  (ASLv2) Apache Commons Lang
+The following NOTICE information applies:
+  Apache Commons Lang
+  Copyright 2001-2015 The Apache Software Foundation
+
+  This product includes software from the Spring Framework,
+  under the Apache License 2.0 (see: StringUtils.containsWhitespace())
+
+  (ASLv2) Apache Commons Logging
+The following NOTICE information applies:
+  Apache Commons Logging
+  Copyright 2003-2016 The Apache Software Foundation
+
+  (ASLv2) Apache HttpComponents
+The following NOTICE information applies:
+  Apache HttpClient
+  Copyright 1999-2015 The Apache Software Foundation
+
+  Apache HttpCore
+  Copyright 2005-2015 The Apache Software Foundation
+
+  Apache HttpMime
+  Copyright 1999-2013 The Apache Software Foundation
+
+  This project contains annotations derived from JCIP-ANNOTATIONS
+  Copyright (c) 2005 Brian Goetz and Tim Peierls. See 
http://www.jcip.net
+
+  (ASLv2) Spring Framework
+The following NOTICE information applies:
+  Spring Framework
+  Copyright 2002-2016 
+  
+  (ASLv2) SubEthaSMTP - A SMTP mail server
+The following NOTICE information applies:
+  Spring Framework
+  Copyright 2006-2007
+
+  (ASLv2) Apache POI
+The following NOTICE information applies:
+
+This product contains parts that were originally based on software 
from BEA.
+Copyright (c) 2000-2003, BEA Systems, .
+
+This product contains W3C XML Schema documents. Copyright 2001-2003 (c)
+World Wide Web Consortium (Massachusetts Institute of Technology, 
European
+Research Consortium for Informatics and Mathematics, Keio University)
+
+This product contains the Piccolo XML Parser for Java
+(http://piccolo.sourceforge.net/). Copyright 2002 Yuval Oren.
+
+This product contains the chunks_parse_cmds.tbl file from the vsdump 
program.
+Copyright (C) 2006-2007 Valek Filippov (f...@df.ru)
+
+This product contains parts of the eID Applet project
+(http://eid-applet.googlecode.com). Copyright (c) 2009-2014
+FedICT (federal ICT department of Belgium), e-Contract.be BVBA 
(https://www.e-contract.be),
+Bart Hanssens from FedICT
+
+CurvesAIP is BSD-licensed software ( 
https://github.com/virtuald/curvesapi/)
+Copyright (c) 2005, Graph Builder
+
+  (ASLv2) Joda Time
+The following NOTICE information applies:
+  This product includes software developed by
+  Joda.org (http://www.joda.org/).
+
+
+
+Common Development and Distribution License 1.1
+
+
+The following binary components are provided under the Common Development 
and Distribution License 1.1. See project link for details.
+
+(CDDL 1.1) (GPL2 w/ CPE) JavaMail API (compat) 
(javax.mail:mail:jar:1.5.6 - https://java.net/projects/javamail/pages/Home)
+
+
+Common Development and Distribution License 1.0
+
+
+The following binary components are provided under the Common Development 
and Distribution License 1.0.  See project link for details.
+
+(CDDL 1.0) JavaBeans Activation Framework (JAF) 
(javax.activation:activation:jar:1.1 - 
http://java.sun.com/products/javabeans/jaf/index.jsp)
+
+
+The MIT License
+
+
+The following binary components are provided under the MIT License.  See 
project link for details.
+
+  (MIT License) EWS Java API
--- End diff --

This just copy-paste from another processor. Could you point to the right 
one license header?


---
If your 

[GitHub] nifi pull request #1662: NIFI-3688 Extended Groovy Nifi Processor

2017-04-11 Thread joewitt
Github user joewitt commented on a diff in the pull request:

https://github.com/apache/nifi/pull/1662#discussion_r110994314
  
--- Diff: 
nifi-nar-bundles/nifi-groovyx-bundle/nifi-groovyx-nar/src/main/resources/META-INF/NOTICE
 ---
@@ -0,0 +1,123 @@
+nifi-groovyx-nar
+Copyright 2014-2017 The Apache Software Foundation
+
+This product includes software developed at
+The Apache Software Foundation (http://www.apache.org/).
+
+**
+Apache Software License v2
+**
+
+The following binary components are provided under the Apache Software 
License v2
+
+  (ASLv2) Apache Commons IO
+The following NOTICE information applies:
+  Apache Commons IO
+  Copyright 2002-2016 The Apache Software Foundation
+
+  (ASLv2) Apache Commons Email
+The following NOTICE information applies:
+  Apache Commons Email
+  Copyright 2002-2016 The Apache Software Foundation
+
+  (ASLv2) Apache Commons Lang
+The following NOTICE information applies:
+  Apache Commons Lang
+  Copyright 2001-2015 The Apache Software Foundation
+
+  This product includes software from the Spring Framework,
+  under the Apache License 2.0 (see: StringUtils.containsWhitespace())
+
+  (ASLv2) Apache Commons Logging
+The following NOTICE information applies:
+  Apache Commons Logging
+  Copyright 2003-2016 The Apache Software Foundation
+
+  (ASLv2) Apache HttpComponents
+The following NOTICE information applies:
+  Apache HttpClient
+  Copyright 1999-2015 The Apache Software Foundation
+
+  Apache HttpCore
+  Copyright 2005-2015 The Apache Software Foundation
+
+  Apache HttpMime
+  Copyright 1999-2013 The Apache Software Foundation
+
+  This project contains annotations derived from JCIP-ANNOTATIONS
+  Copyright (c) 2005 Brian Goetz and Tim Peierls. See 
http://www.jcip.net
+
+  (ASLv2) Spring Framework
+The following NOTICE information applies:
+  Spring Framework
+  Copyright 2002-2016 
+  
+  (ASLv2) SubEthaSMTP - A SMTP mail server
+The following NOTICE information applies:
+  Spring Framework
+  Copyright 2006-2007
+
+  (ASLv2) Apache POI
+The following NOTICE information applies:
+
+This product contains parts that were originally based on software 
from BEA.
+Copyright (c) 2000-2003, BEA Systems, .
+
+This product contains W3C XML Schema documents. Copyright 2001-2003 (c)
+World Wide Web Consortium (Massachusetts Institute of Technology, 
European
+Research Consortium for Informatics and Mathematics, Keio University)
+
+This product contains the Piccolo XML Parser for Java
+(http://piccolo.sourceforge.net/). Copyright 2002 Yuval Oren.
+
+This product contains the chunks_parse_cmds.tbl file from the vsdump 
program.
+Copyright (C) 2006-2007 Valek Filippov (f...@df.ru)
+
+This product contains parts of the eID Applet project
+(http://eid-applet.googlecode.com). Copyright (c) 2009-2014
+FedICT (federal ICT department of Belgium), e-Contract.be BVBA 
(https://www.e-contract.be),
+Bart Hanssens from FedICT
+
+CurvesAIP is BSD-licensed software ( 
https://github.com/virtuald/curvesapi/)
+Copyright (c) 2005, Graph Builder
+
+  (ASLv2) Joda Time
+The following NOTICE information applies:
+  This product includes software developed by
+  Joda.org (http://www.joda.org/).
+
+
+
+Common Development and Distribution License 1.1
+
+
+The following binary components are provided under the Common Development 
and Distribution License 1.1. See project link for details.
+
+(CDDL 1.1) (GPL2 w/ CPE) JavaMail API (compat) 
(javax.mail:mail:jar:1.5.6 - https://java.net/projects/javamail/pages/Home)
+
+
+Common Development and Distribution License 1.0
+
+
+The following binary components are provided under the Common Development 
and Distribution License 1.0.  See project link for details.
+
+(CDDL 1.0) JavaBeans Activation Framework (JAF) 
(javax.activation:activation:jar:1.1 - 
http://java.sun.com/products/javabeans/jaf/index.jsp)
+
+
+The MIT License
+
+
+The following binary components are provided under the MIT License.  See 
project link for details.
+
+  (MIT License) EWS Java API
--- End diff --

You don't need to reference CategoryA deps in the NOTICE which are already 
covered in the LICENSE.  This MIT dep and 

[GitHub] nifi pull request #1662: NIFI-3688 Extended Groovy Nifi Processor

2017-04-11 Thread joewitt
Github user joewitt commented on a diff in the pull request:

https://github.com/apache/nifi/pull/1662#discussion_r110994393
  
--- Diff: 
nifi-nar-bundles/nifi-groovyx-bundle/nifi-groovyx-processors/src/main/java/org/apache/nifi/processors/groovyx/GroovyMethods.java
 ---
@@ -0,0 +1,266 @@
+/*
+ * 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.nifi.processors.groovyx;
+
+import groovy.lang.Closure;
+import groovy.lang.DelegatingMetaClass;
+import groovy.lang.GroovySystem;
+import groovy.lang.MetaClass;
+import groovy.lang.Writable;
+
+import org.apache.nifi.processors.groovyx.flow.ProcessSessionWrap;
+import org.apache.nifi.processors.groovyx.flow.SessionFile;
+
+import org.apache.nifi.processor.Relationship;
+import org.apache.nifi.processor.FlowFileFilter;
+import org.apache.nifi.processor.FlowFileFilter.FlowFileFilterResult;
+//import org.apache.nifi.processor.ProcessSession;
--- End diff --

please remove


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] nifi pull request #1662: NIFI-3688 Extended Groovy Nifi Processor

2017-04-10 Thread dlukyanov
Github user dlukyanov commented on a diff in the pull request:

https://github.com/apache/nifi/pull/1662#discussion_r110773203
  
--- Diff: nifi-nar-bundles/nifi-groovyx-bundle/nifi-groovyx-nar/pom.xml ---
@@ -0,0 +1,44 @@
+
+
+http://maven.apache.org/POM/4.0.0; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance; 
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd;>
+4.0.0
+
+
+org.apache.nifi
+nifi-groovyx-bundle
+1.2.0-SNAPSHOT
+
+
+nifi-groovyx-nar
+nar
+
+true
--- End diff --

no reason. i'll fix it.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] nifi pull request #1662: NIFI-3688 Extended Groovy Nifi Processor

2017-04-10 Thread alopresto
Github user alopresto commented on a diff in the pull request:

https://github.com/apache/nifi/pull/1662#discussion_r110773031
  
--- Diff: nifi-nar-bundles/nifi-groovyx-bundle/nifi-groovyx-nar/pom.xml ---
@@ -0,0 +1,44 @@
+
+
+http://maven.apache.org/POM/4.0.0; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance; 
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd;>
+4.0.0
+
+
+org.apache.nifi
+nifi-groovyx-bundle
+1.2.0-SNAPSHOT
+
+
+nifi-groovyx-nar
+nar
+
+true
--- End diff --

I don't think this is compatible with our coding style guide. Is there a 
reason Javadoc needs to be skipped?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] nifi pull request #1662: NIFI-3688 Extended Groovy Nifi Processor

2017-04-10 Thread dlukyanov
GitHub user dlukyanov opened a pull request:

https://github.com/apache/nifi/pull/1662

NIFI-3688 Extended Groovy Nifi Processor 

Thank you for submitting a contribution to Apache NiFi.

In order to streamline the review of the contribution we ask you
to ensure the following steps have been taken:

### For all changes:
- [YES] Is there a JIRA ticket associated with this PR? Is it referenced 
 in the commit message?
 in last one only

- [YES] Does your PR title start with NIFI- where  is the JIRA 
number you are trying to resolve? Pay particular attention to the hyphen "-" 
character.

- [YES] Has your PR been rebased against the latest commit within the 
target branch (typically master)?

- [YES?] Is your initial contribution a single, squashed commit?
 
### For code changes:
- [YES] Have you ensured that the full suite of tests is executed via mvn 
-Pcontrib-check clean install at the root nifi folder?
- [NO] Have you written or updated unit tests to verify your changes?
 no changes done to existing code. but no tests to groovyx processor.
- [YES] If adding new dependencies to the code, are these dependencies 
licensed in a way that is compatible for inclusion under [ASF 
2.0](http://www.apache.org/legal/resolved.html#category-a)? 
- [YES?] If applicable, have you updated the LICENSE file, including the 
main LICENSE file under nifi-assembly?
- [YES?] If applicable, have you updated the NOTICE file, including the 
main NOTICE file found under nifi-assembly?
- [NO] If adding new Properties, have you added .displayName in addition to 
.name (programmatic access) for each of the new properties?
 not applicable?
### For documentation related changes:
- [YES] Have you ensured that format looks appropriate for the output in 
which it is rendered?

### Note:
Please ensure that once the PR is submitted, you check travis-ci for build 
issues and submit an update to your PR as soon as possible.


You can merge this pull request into a Git repository by running:

$ git pull https://github.com/dlukyanov/nifi master

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/nifi/pull/1662.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #1662


commit 279e0502deef66d2a2934a211430aac52d3a5b28
Author: dlukyanov 
Date:   2017-04-02T07:55:22Z

groovyx initial version

commit 0bb6f9f970b186b6ec018d70e5afa68c9345b7c1
Author: dlukyanov 
Date:   2017-04-10T21:09:54Z

https://issues.apache.org/jira/browse/NIFI-3688

commit 8d142dd629fee4f42434f754c16c897edfa08447
Author: dlukyanov 
Date:   2017-04-10T21:22:38Z

NIFI-3688 license update to ASF

commit cd26cb1f3f2ebcbdc2ebda8904c424c62f2e5298
Author: dlukyanov 
Date:   2017-04-10T21:24:30Z

NIFI-3688 add groovyx dependency




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---