[jira] [Commented] (NIFI-4583) Restructure package nifi-solr-processors

2018-01-04 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/NIFI-4583?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16310993#comment-16310993
 ] 

ASF GitHub Bot commented on NIFI-4583:
--

Github user ijokarumawak commented on the issue:

https://github.com/apache/nifi/pull/2285
  
@JohannesDaniel Technically, we can [amend old commit 
info](https://stackoverflow.com/questions/3042437/change-commit-author-at-one-specific-commit).
 However, I think it requires a force push, which may lose commits if coming at 
the same time, and for every local branch people cloned to be updated. So if we 
decide to do that operation, we need to announce that to NiFi dev ML at least. 
Please initiate such conversation at NiFi dev ML if needed. Thank you.


> Restructure package nifi-solr-processors
> 
>
> Key: NIFI-4583
> URL: https://issues.apache.org/jira/browse/NIFI-4583
> Project: Apache NiFi
>  Issue Type: Improvement
>Reporter: Johannes Peter
>Assignee: Johannes Peter
>Priority: Minor
> Fix For: 1.5.0
>
>
> Several functionalities currently implemented e. g. in GetSolr or 
> SolrProcessor should be made available for other processors or controller 
> services. A class SolrUtils should be created containing several static 
> methods. This includes the methods 
> - getRequestParams (PutSolrContentStream)
> - solrDocumentsToRecordSet (GetSolr) 
> - createSolrClient (SolrProcessor)
> and the inner class QueryResponseOutputStreamCallback (GetSolr)
> Some unit tests might be affected.
> The method declaration  
> protected SolrClient createSolrClient(final ProcessContext context, final 
> String solrLocation)
> should be changed to 
> public static SolrClient createSolrClient(final PropertyContext context, 
> final String solrLocation)
> to be suitable also for controller services.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (NIFI-4583) Restructure package nifi-solr-processors

2018-01-04 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/NIFI-4583?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16310995#comment-16310995
 ] 

ASF GitHub Bot commented on NIFI-4583:
--

Github user ijokarumawak commented on the issue:

https://github.com/apache/nifi/pull/2285
  
So, I'd prefer leaving as it is if it's not too critical.


> Restructure package nifi-solr-processors
> 
>
> Key: NIFI-4583
> URL: https://issues.apache.org/jira/browse/NIFI-4583
> Project: Apache NiFi
>  Issue Type: Improvement
>Reporter: Johannes Peter
>Assignee: Johannes Peter
>Priority: Minor
> Fix For: 1.5.0
>
>
> Several functionalities currently implemented e. g. in GetSolr or 
> SolrProcessor should be made available for other processors or controller 
> services. A class SolrUtils should be created containing several static 
> methods. This includes the methods 
> - getRequestParams (PutSolrContentStream)
> - solrDocumentsToRecordSet (GetSolr) 
> - createSolrClient (SolrProcessor)
> and the inner class QueryResponseOutputStreamCallback (GetSolr)
> Some unit tests might be affected.
> The method declaration  
> protected SolrClient createSolrClient(final ProcessContext context, final 
> String solrLocation)
> should be changed to 
> public static SolrClient createSolrClient(final PropertyContext context, 
> final String solrLocation)
> to be suitable also for controller services.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (NIFI-4583) Restructure package nifi-solr-processors

2018-01-03 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/NIFI-4583?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16309519#comment-16309519
 ] 

ASF GitHub Bot commented on NIFI-4583:
--

Github user JohannesDaniel commented on the issue:

https://github.com/apache/nifi/pull/2285
  
Ah I see. Sorry for this. Will we leave it as it (for this commit) is or 
can we fix this?


> Restructure package nifi-solr-processors
> 
>
> Key: NIFI-4583
> URL: https://issues.apache.org/jira/browse/NIFI-4583
> Project: Apache NiFi
>  Issue Type: Improvement
>Reporter: Johannes Peter
>Assignee: Johannes Peter
>Priority: Minor
> Fix For: 1.5.0
>
>
> Several functionalities currently implemented e. g. in GetSolr or 
> SolrProcessor should be made available for other processors or controller 
> services. A class SolrUtils should be created containing several static 
> methods. This includes the methods 
> - getRequestParams (PutSolrContentStream)
> - solrDocumentsToRecordSet (GetSolr) 
> - createSolrClient (SolrProcessor)
> and the inner class QueryResponseOutputStreamCallback (GetSolr)
> Some unit tests might be affected.
> The method declaration  
> protected SolrClient createSolrClient(final ProcessContext context, final 
> String solrLocation)
> should be changed to 
> public static SolrClient createSolrClient(final PropertyContext context, 
> final String solrLocation)
> to be suitable also for controller services.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (NIFI-4583) Restructure package nifi-solr-processors

2018-01-03 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/NIFI-4583?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16309494#comment-16309494
 ] 

ASF GitHub Bot commented on NIFI-4583:
--

Github user ijokarumawak commented on the issue:

https://github.com/apache/nifi/pull/2285
  
@JohannesDaniel Would you check your working environment setting, 
especially email address? I just squashed commits into one and pushed into 
master branch, didn't modify author info.
https://help.github.com/articles/setting-your-commit-email-address-in-git/


> Restructure package nifi-solr-processors
> 
>
> Key: NIFI-4583
> URL: https://issues.apache.org/jira/browse/NIFI-4583
> Project: Apache NiFi
>  Issue Type: Improvement
>Reporter: Johannes Peter
>Assignee: Johannes Peter
>Priority: Minor
> Fix For: 1.5.0
>
>
> Several functionalities currently implemented e. g. in GetSolr or 
> SolrProcessor should be made available for other processors or controller 
> services. A class SolrUtils should be created containing several static 
> methods. This includes the methods 
> - getRequestParams (PutSolrContentStream)
> - solrDocumentsToRecordSet (GetSolr) 
> - createSolrClient (SolrProcessor)
> and the inner class QueryResponseOutputStreamCallback (GetSolr)
> Some unit tests might be affected.
> The method declaration  
> protected SolrClient createSolrClient(final ProcessContext context, final 
> String solrLocation)
> should be changed to 
> public static SolrClient createSolrClient(final PropertyContext context, 
> final String solrLocation)
> to be suitable also for controller services.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (NIFI-4583) Restructure package nifi-solr-processors

2018-01-03 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/NIFI-4583?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16309429#comment-16309429
 ] 

ASF GitHub Bot commented on NIFI-4583:
--

Github user JohannesDaniel commented on the issue:

https://github.com/apache/nifi/pull/2285
  
@ijokarumawak not too important, but do you know why this commit is not 
linked to my account? it is linked to "U-WOODMARK\johannes.peter"


> Restructure package nifi-solr-processors
> 
>
> Key: NIFI-4583
> URL: https://issues.apache.org/jira/browse/NIFI-4583
> Project: Apache NiFi
>  Issue Type: Improvement
>Reporter: Johannes Peter
>Assignee: Johannes Peter
>Priority: Minor
> Fix For: 1.5.0
>
>
> Several functionalities currently implemented e. g. in GetSolr or 
> SolrProcessor should be made available for other processors or controller 
> services. A class SolrUtils should be created containing several static 
> methods. This includes the methods 
> - getRequestParams (PutSolrContentStream)
> - solrDocumentsToRecordSet (GetSolr) 
> - createSolrClient (SolrProcessor)
> and the inner class QueryResponseOutputStreamCallback (GetSolr)
> Some unit tests might be affected.
> The method declaration  
> protected SolrClient createSolrClient(final ProcessContext context, final 
> String solrLocation)
> should be changed to 
> public static SolrClient createSolrClient(final PropertyContext context, 
> final String solrLocation)
> to be suitable also for controller services.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (NIFI-4583) Restructure package nifi-solr-processors

2018-01-02 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/NIFI-4583?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16308957#comment-16308957
 ] 

ASF GitHub Bot commented on NIFI-4583:
--

Github user asfgit closed the pull request at:

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


> Restructure package nifi-solr-processors
> 
>
> Key: NIFI-4583
> URL: https://issues.apache.org/jira/browse/NIFI-4583
> Project: Apache NiFi
>  Issue Type: Improvement
>Reporter: Johannes Peter
>Assignee: Johannes Peter
>Priority: Minor
>
> Several functionalities currently implemented e. g. in GetSolr or 
> SolrProcessor should be made available for other processors or controller 
> services. A class SolrUtils should be created containing several static 
> methods. This includes the methods 
> - getRequestParams (PutSolrContentStream)
> - solrDocumentsToRecordSet (GetSolr) 
> - createSolrClient (SolrProcessor)
> and the inner class QueryResponseOutputStreamCallback (GetSolr)
> Some unit tests might be affected.
> The method declaration  
> protected SolrClient createSolrClient(final ProcessContext context, final 
> String solrLocation)
> should be changed to 
> public static SolrClient createSolrClient(final PropertyContext context, 
> final String solrLocation)
> to be suitable also for controller services.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (NIFI-4583) Restructure package nifi-solr-processors

2018-01-02 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/NIFI-4583?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16308956#comment-16308956
 ] 

ASF subversion and git services commented on NIFI-4583:
---

Commit 9f919b9b650bbec647d1d5acbc1a63b721ce84e3 in nifi's branch 
refs/heads/master from U-WOODMARK\johannes.peter
[ https://git-wip-us.apache.org/repos/asf?p=nifi.git;h=9f919b9 ]

NIFI-4583 Restructure nifi-solr-processors

Make all methods static

NIFI-4583 Restructure nifi-solr-processors R2

This closes #2285.

Signed-off-by: Koji Kawamura 


> Restructure package nifi-solr-processors
> 
>
> Key: NIFI-4583
> URL: https://issues.apache.org/jira/browse/NIFI-4583
> Project: Apache NiFi
>  Issue Type: Improvement
>Reporter: Johannes Peter
>Assignee: Johannes Peter
>Priority: Minor
>
> Several functionalities currently implemented e. g. in GetSolr or 
> SolrProcessor should be made available for other processors or controller 
> services. A class SolrUtils should be created containing several static 
> methods. This includes the methods 
> - getRequestParams (PutSolrContentStream)
> - solrDocumentsToRecordSet (GetSolr) 
> - createSolrClient (SolrProcessor)
> and the inner class QueryResponseOutputStreamCallback (GetSolr)
> Some unit tests might be affected.
> The method declaration  
> protected SolrClient createSolrClient(final ProcessContext context, final 
> String solrLocation)
> should be changed to 
> public static SolrClient createSolrClient(final PropertyContext context, 
> final String solrLocation)
> to be suitable also for controller services.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (NIFI-4583) Restructure package nifi-solr-processors

2018-01-02 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/NIFI-4583?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16308955#comment-16308955
 ] 

ASF subversion and git services commented on NIFI-4583:
---

Commit 9f919b9b650bbec647d1d5acbc1a63b721ce84e3 in nifi's branch 
refs/heads/master from U-WOODMARK\johannes.peter
[ https://git-wip-us.apache.org/repos/asf?p=nifi.git;h=9f919b9 ]

NIFI-4583 Restructure nifi-solr-processors

Make all methods static

NIFI-4583 Restructure nifi-solr-processors R2

This closes #2285.

Signed-off-by: Koji Kawamura 


> Restructure package nifi-solr-processors
> 
>
> Key: NIFI-4583
> URL: https://issues.apache.org/jira/browse/NIFI-4583
> Project: Apache NiFi
>  Issue Type: Improvement
>Reporter: Johannes Peter
>Assignee: Johannes Peter
>Priority: Minor
>
> Several functionalities currently implemented e. g. in GetSolr or 
> SolrProcessor should be made available for other processors or controller 
> services. A class SolrUtils should be created containing several static 
> methods. This includes the methods 
> - getRequestParams (PutSolrContentStream)
> - solrDocumentsToRecordSet (GetSolr) 
> - createSolrClient (SolrProcessor)
> and the inner class QueryResponseOutputStreamCallback (GetSolr)
> Some unit tests might be affected.
> The method declaration  
> protected SolrClient createSolrClient(final ProcessContext context, final 
> String solrLocation)
> should be changed to 
> public static SolrClient createSolrClient(final PropertyContext context, 
> final String solrLocation)
> to be suitable also for controller services.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (NIFI-4583) Restructure package nifi-solr-processors

2018-01-02 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/NIFI-4583?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16308930#comment-16308930
 ] 

ASF GitHub Bot commented on NIFI-4583:
--

Github user ijokarumawak commented on the issue:

https://github.com/apache/nifi/pull/2285
  
@JohannesDaniel Thanks for the updates. Now it LGTM, +1. Merging in. Thank 
you for your contribution!


> Restructure package nifi-solr-processors
> 
>
> Key: NIFI-4583
> URL: https://issues.apache.org/jira/browse/NIFI-4583
> Project: Apache NiFi
>  Issue Type: Improvement
>Reporter: Johannes Peter
>Assignee: Johannes Peter
>Priority: Minor
>
> Several functionalities currently implemented e. g. in GetSolr or 
> SolrProcessor should be made available for other processors or controller 
> services. A class SolrUtils should be created containing several static 
> methods. This includes the methods 
> - getRequestParams (PutSolrContentStream)
> - solrDocumentsToRecordSet (GetSolr) 
> - createSolrClient (SolrProcessor)
> and the inner class QueryResponseOutputStreamCallback (GetSolr)
> Some unit tests might be affected.
> The method declaration  
> protected SolrClient createSolrClient(final ProcessContext context, final 
> String solrLocation)
> should be changed to 
> public static SolrClient createSolrClient(final PropertyContext context, 
> final String solrLocation)
> to be suitable also for controller services.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (NIFI-4583) Restructure package nifi-solr-processors

2017-12-30 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/NIFI-4583?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16306795#comment-16306795
 ] 

ASF GitHub Bot commented on NIFI-4583:
--

Github user JohannesDaniel commented on the issue:

https://github.com/apache/nifi/pull/2285
  
I replaced the values by static imports


> Restructure package nifi-solr-processors
> 
>
> Key: NIFI-4583
> URL: https://issues.apache.org/jira/browse/NIFI-4583
> Project: Apache NiFi
>  Issue Type: Improvement
>Reporter: Johannes Peter
>Assignee: Johannes Peter
>Priority: Minor
>
> Several functionalities currently implemented e. g. in GetSolr or 
> SolrProcessor should be made available for other processors or controller 
> services. A class SolrUtils should be created containing several static 
> methods. This includes the methods 
> - getRequestParams (PutSolrContentStream)
> - solrDocumentsToRecordSet (GetSolr) 
> - createSolrClient (SolrProcessor)
> and the inner class QueryResponseOutputStreamCallback (GetSolr)
> Some unit tests might be affected.
> The method declaration  
> protected SolrClient createSolrClient(final ProcessContext context, final 
> String solrLocation)
> should be changed to 
> public static SolrClient createSolrClient(final PropertyContext context, 
> final String solrLocation)
> to be suitable also for controller services.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (NIFI-4583) Restructure package nifi-solr-processors

2017-12-30 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/NIFI-4583?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16306792#comment-16306792
 ] 

ASF GitHub Bot commented on NIFI-4583:
--

Github user JohannesDaniel commented on the issue:

https://github.com/apache/nifi/pull/2285
  
I made TestGetSolr a bit more simpler by adding a method for the generic 
creation of TestRunners. I moved all remaining PropertyDescriptors from 
SolrProcessor to SolrUtils as they will be needed also for e. g. 
ControllerServices. 


> Restructure package nifi-solr-processors
> 
>
> Key: NIFI-4583
> URL: https://issues.apache.org/jira/browse/NIFI-4583
> Project: Apache NiFi
>  Issue Type: Improvement
>Reporter: Johannes Peter
>Assignee: Johannes Peter
>Priority: Minor
>
> Several functionalities currently implemented e. g. in GetSolr or 
> SolrProcessor should be made available for other processors or controller 
> services. A class SolrUtils should be created containing several static 
> methods. This includes the methods 
> - getRequestParams (PutSolrContentStream)
> - solrDocumentsToRecordSet (GetSolr) 
> - createSolrClient (SolrProcessor)
> and the inner class QueryResponseOutputStreamCallback (GetSolr)
> Some unit tests might be affected.
> The method declaration  
> protected SolrClient createSolrClient(final ProcessContext context, final 
> String solrLocation)
> should be changed to 
> public static SolrClient createSolrClient(final PropertyContext context, 
> final String solrLocation)
> to be suitable also for controller services.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (NIFI-4583) Restructure package nifi-solr-processors

2017-12-30 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/NIFI-4583?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16306789#comment-16306789
 ] 

ASF GitHub Bot commented on NIFI-4583:
--

Github user JohannesDaniel commented on a diff in the pull request:

https://github.com/apache/nifi/pull/2285#discussion_r159123401
  
--- Diff: 
nifi-nar-bundles/nifi-solr-bundle/nifi-solr-processors/src/main/java/org/apache/nifi/processors/solr/SolrProcessor.java
 ---
@@ -34,39 +31,33 @@
 import org.apache.nifi.processor.util.StandardValidators;
 import org.apache.nifi.ssl.SSLContextService;
 import org.apache.solr.client.solrj.SolrClient;
-import org.apache.solr.client.solrj.impl.CloudSolrClient;
-import org.apache.solr.client.solrj.impl.HttpClientUtil;
-import org.apache.solr.client.solrj.impl.HttpSolrClient;
 import org.apache.solr.client.solrj.impl.Krb5HttpClientConfigurer;
-import org.apache.solr.common.params.ModifiableSolrParams;
 
-import javax.net.ssl.SSLContext;
 import javax.security.auth.login.Configuration;
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.List;
-import java.util.concurrent.TimeUnit;
 
 /**
  * A base class for processors that interact with Apache Solr.
  *
  */
 public abstract class SolrProcessor extends AbstractProcessor {
 
-public static final AllowableValue SOLR_TYPE_CLOUD = new 
AllowableValue(
-"Cloud", "Cloud", "A SolrCloud instance.");
-
-public static final AllowableValue SOLR_TYPE_STANDARD = new 
AllowableValue(
-"Standard", "Standard", "A stand-alone Solr instance.");
-
-public static final PropertyDescriptor SOLR_TYPE = new 
PropertyDescriptor
-.Builder().name("Solr Type")
-.description("The type of Solr instance, Cloud or Standard.")
-.required(true)
-.allowableValues(SOLR_TYPE_CLOUD, SOLR_TYPE_STANDARD)
-.defaultValue(SOLR_TYPE_STANDARD.getValue())
-.build();
+// make PropertyDescriptors of SolrUtils visible for classes extending 
SolrProcessor
+public static AllowableValue SOLR_TYPE_CLOUD = 
SolrUtils.SOLR_TYPE_CLOUD;
+public static AllowableValue SOLR_TYPE_STANDARD = 
SolrUtils.SOLR_TYPE_STANDARD;
+public static PropertyDescriptor SOLR_TYPE = SolrUtils.SOLR_TYPE;
+public static PropertyDescriptor COLLECTION = SolrUtils.COLLECTION;
+public static PropertyDescriptor JAAS_CLIENT_APP_NAME = 
SolrUtils.JAAS_CLIENT_APP_NAME;
+public static PropertyDescriptor SSL_CONTEXT_SERVICE = 
SolrUtils.SSL_CONTEXT_SERVICE;
+public static PropertyDescriptor SOLR_SOCKET_TIMEOUT = 
SolrUtils.SOLR_SOCKET_TIMEOUT;
+public static PropertyDescriptor SOLR_CONNECTION_TIMEOUT = 
SolrUtils.SOLR_CONNECTION_TIMEOUT;
+public static PropertyDescriptor SOLR_MAX_CONNECTIONS = 
SolrUtils.SOLR_MAX_CONNECTIONS;
+public static PropertyDescriptor SOLR_MAX_CONNECTIONS_PER_HOST = 
SolrUtils.SOLR_MAX_CONNECTIONS_PER_HOST;
+public static PropertyDescriptor ZK_CLIENT_TIMEOUT = 
SolrUtils.ZK_CLIENT_TIMEOUT;
+public static PropertyDescriptor ZK_CONNECTION_TIMEOUT = 
SolrUtils.ZK_CONNECTION_TIMEOUT;
--- End diff --

You are right! I would add new PropertyDescriptors  only to SolrProcessor 
if the are only supposed to be used for processors. 


> Restructure package nifi-solr-processors
> 
>
> Key: NIFI-4583
> URL: https://issues.apache.org/jira/browse/NIFI-4583
> Project: Apache NiFi
>  Issue Type: Improvement
>Reporter: Johannes Peter
>Assignee: Johannes Peter
>Priority: Minor
>
> Several functionalities currently implemented e. g. in GetSolr or 
> SolrProcessor should be made available for other processors or controller 
> services. A class SolrUtils should be created containing several static 
> methods. This includes the methods 
> - getRequestParams (PutSolrContentStream)
> - solrDocumentsToRecordSet (GetSolr) 
> - createSolrClient (SolrProcessor)
> and the inner class QueryResponseOutputStreamCallback (GetSolr)
> Some unit tests might be affected.
> The method declaration  
> protected SolrClient createSolrClient(final ProcessContext context, final 
> String solrLocation)
> should be changed to 
> public static SolrClient createSolrClient(final PropertyContext context, 
> final String solrLocation)
> to be suitable also for controller services.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (NIFI-4583) Restructure package nifi-solr-processors

2017-12-30 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/NIFI-4583?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16306776#comment-16306776
 ] 

ASF GitHub Bot commented on NIFI-4583:
--

Github user ijokarumawak commented on a diff in the pull request:

https://github.com/apache/nifi/pull/2285#discussion_r159122877
  
--- Diff: 
nifi-nar-bundles/nifi-solr-bundle/nifi-solr-processors/src/main/java/org/apache/nifi/processors/solr/SolrProcessor.java
 ---
@@ -34,39 +31,33 @@
 import org.apache.nifi.processor.util.StandardValidators;
 import org.apache.nifi.ssl.SSLContextService;
 import org.apache.solr.client.solrj.SolrClient;
-import org.apache.solr.client.solrj.impl.CloudSolrClient;
-import org.apache.solr.client.solrj.impl.HttpClientUtil;
-import org.apache.solr.client.solrj.impl.HttpSolrClient;
 import org.apache.solr.client.solrj.impl.Krb5HttpClientConfigurer;
-import org.apache.solr.common.params.ModifiableSolrParams;
 
-import javax.net.ssl.SSLContext;
 import javax.security.auth.login.Configuration;
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.List;
-import java.util.concurrent.TimeUnit;
 
 /**
  * A base class for processors that interact with Apache Solr.
  *
  */
 public abstract class SolrProcessor extends AbstractProcessor {
 
-public static final AllowableValue SOLR_TYPE_CLOUD = new 
AllowableValue(
-"Cloud", "Cloud", "A SolrCloud instance.");
-
-public static final AllowableValue SOLR_TYPE_STANDARD = new 
AllowableValue(
-"Standard", "Standard", "A stand-alone Solr instance.");
-
-public static final PropertyDescriptor SOLR_TYPE = new 
PropertyDescriptor
-.Builder().name("Solr Type")
-.description("The type of Solr instance, Cloud or Standard.")
-.required(true)
-.allowableValues(SOLR_TYPE_CLOUD, SOLR_TYPE_STANDARD)
-.defaultValue(SOLR_TYPE_STANDARD.getValue())
-.build();
+// make PropertyDescriptors of SolrUtils visible for classes extending 
SolrProcessor
+public static AllowableValue SOLR_TYPE_CLOUD = 
SolrUtils.SOLR_TYPE_CLOUD;
+public static AllowableValue SOLR_TYPE_STANDARD = 
SolrUtils.SOLR_TYPE_STANDARD;
+public static PropertyDescriptor SOLR_TYPE = SolrUtils.SOLR_TYPE;
+public static PropertyDescriptor COLLECTION = SolrUtils.COLLECTION;
+public static PropertyDescriptor JAAS_CLIENT_APP_NAME = 
SolrUtils.JAAS_CLIENT_APP_NAME;
+public static PropertyDescriptor SSL_CONTEXT_SERVICE = 
SolrUtils.SSL_CONTEXT_SERVICE;
+public static PropertyDescriptor SOLR_SOCKET_TIMEOUT = 
SolrUtils.SOLR_SOCKET_TIMEOUT;
+public static PropertyDescriptor SOLR_CONNECTION_TIMEOUT = 
SolrUtils.SOLR_CONNECTION_TIMEOUT;
+public static PropertyDescriptor SOLR_MAX_CONNECTIONS = 
SolrUtils.SOLR_MAX_CONNECTIONS;
+public static PropertyDescriptor SOLR_MAX_CONNECTIONS_PER_HOST = 
SolrUtils.SOLR_MAX_CONNECTIONS_PER_HOST;
+public static PropertyDescriptor ZK_CLIENT_TIMEOUT = 
SolrUtils.ZK_CLIENT_TIMEOUT;
+public static PropertyDescriptor ZK_CONNECTION_TIMEOUT = 
SolrUtils.ZK_CONNECTION_TIMEOUT;
--- End diff --

I think this PR's goal is restructuring existing code by centralizing 
common implementations into SolrUtils. Nothing wrong to change existing code. 
Do you envision when you add new PropertyDescriptor, you prefer to add it in 
SolrUtils and also in SolrProcessor? If you still prefer leave it as it is, 
please let me know. I just wanted to confirm before I merge this. Thanks!


> Restructure package nifi-solr-processors
> 
>
> Key: NIFI-4583
> URL: https://issues.apache.org/jira/browse/NIFI-4583
> Project: Apache NiFi
>  Issue Type: Improvement
>Reporter: Johannes Peter
>Assignee: Johannes Peter
>Priority: Minor
>
> Several functionalities currently implemented e. g. in GetSolr or 
> SolrProcessor should be made available for other processors or controller 
> services. A class SolrUtils should be created containing several static 
> methods. This includes the methods 
> - getRequestParams (PutSolrContentStream)
> - solrDocumentsToRecordSet (GetSolr) 
> - createSolrClient (SolrProcessor)
> and the inner class QueryResponseOutputStreamCallback (GetSolr)
> Some unit tests might be affected.
> The method declaration  
> protected SolrClient createSolrClient(final ProcessContext context, final 
> String solrLocation)
> should be changed to 
> public static SolrClient createSolrClient(final PropertyContext context, 
> final String solrLocation)
> to be suitable also for controller services.



--
This message was 

[jira] [Commented] (NIFI-4583) Restructure package nifi-solr-processors

2017-12-30 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/NIFI-4583?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16306770#comment-16306770
 ] 

ASF GitHub Bot commented on NIFI-4583:
--

Github user JohannesDaniel commented on a diff in the pull request:

https://github.com/apache/nifi/pull/2285#discussion_r159122745
  
--- Diff: 
nifi-nar-bundles/nifi-solr-bundle/nifi-solr-processors/src/main/java/org/apache/nifi/processors/solr/SolrProcessor.java
 ---
@@ -34,39 +31,33 @@
 import org.apache.nifi.processor.util.StandardValidators;
 import org.apache.nifi.ssl.SSLContextService;
 import org.apache.solr.client.solrj.SolrClient;
-import org.apache.solr.client.solrj.impl.CloudSolrClient;
-import org.apache.solr.client.solrj.impl.HttpClientUtil;
-import org.apache.solr.client.solrj.impl.HttpSolrClient;
 import org.apache.solr.client.solrj.impl.Krb5HttpClientConfigurer;
-import org.apache.solr.common.params.ModifiableSolrParams;
 
-import javax.net.ssl.SSLContext;
 import javax.security.auth.login.Configuration;
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.List;
-import java.util.concurrent.TimeUnit;
 
 /**
  * A base class for processors that interact with Apache Solr.
  *
  */
 public abstract class SolrProcessor extends AbstractProcessor {
 
-public static final AllowableValue SOLR_TYPE_CLOUD = new 
AllowableValue(
-"Cloud", "Cloud", "A SolrCloud instance.");
-
-public static final AllowableValue SOLR_TYPE_STANDARD = new 
AllowableValue(
-"Standard", "Standard", "A stand-alone Solr instance.");
-
-public static final PropertyDescriptor SOLR_TYPE = new 
PropertyDescriptor
-.Builder().name("Solr Type")
-.description("The type of Solr instance, Cloud or Standard.")
-.required(true)
-.allowableValues(SOLR_TYPE_CLOUD, SOLR_TYPE_STANDARD)
-.defaultValue(SOLR_TYPE_STANDARD.getValue())
-.build();
+// make PropertyDescriptors of SolrUtils visible for classes extending 
SolrProcessor
+public static AllowableValue SOLR_TYPE_CLOUD = 
SolrUtils.SOLR_TYPE_CLOUD;
+public static AllowableValue SOLR_TYPE_STANDARD = 
SolrUtils.SOLR_TYPE_STANDARD;
+public static PropertyDescriptor SOLR_TYPE = SolrUtils.SOLR_TYPE;
+public static PropertyDescriptor COLLECTION = SolrUtils.COLLECTION;
+public static PropertyDescriptor JAAS_CLIENT_APP_NAME = 
SolrUtils.JAAS_CLIENT_APP_NAME;
+public static PropertyDescriptor SSL_CONTEXT_SERVICE = 
SolrUtils.SSL_CONTEXT_SERVICE;
+public static PropertyDescriptor SOLR_SOCKET_TIMEOUT = 
SolrUtils.SOLR_SOCKET_TIMEOUT;
+public static PropertyDescriptor SOLR_CONNECTION_TIMEOUT = 
SolrUtils.SOLR_CONNECTION_TIMEOUT;
+public static PropertyDescriptor SOLR_MAX_CONNECTIONS = 
SolrUtils.SOLR_MAX_CONNECTIONS;
+public static PropertyDescriptor SOLR_MAX_CONNECTIONS_PER_HOST = 
SolrUtils.SOLR_MAX_CONNECTIONS_PER_HOST;
+public static PropertyDescriptor ZK_CLIENT_TIMEOUT = 
SolrUtils.ZK_CLIENT_TIMEOUT;
+public static PropertyDescriptor ZK_CONNECTION_TIMEOUT = 
SolrUtils.ZK_CONNECTION_TIMEOUT;
--- End diff --

I suggest to leave it as it is...


> Restructure package nifi-solr-processors
> 
>
> Key: NIFI-4583
> URL: https://issues.apache.org/jira/browse/NIFI-4583
> Project: Apache NiFi
>  Issue Type: Improvement
>Reporter: Johannes Peter
>Assignee: Johannes Peter
>Priority: Minor
>
> Several functionalities currently implemented e. g. in GetSolr or 
> SolrProcessor should be made available for other processors or controller 
> services. A class SolrUtils should be created containing several static 
> methods. This includes the methods 
> - getRequestParams (PutSolrContentStream)
> - solrDocumentsToRecordSet (GetSolr) 
> - createSolrClient (SolrProcessor)
> and the inner class QueryResponseOutputStreamCallback (GetSolr)
> Some unit tests might be affected.
> The method declaration  
> protected SolrClient createSolrClient(final ProcessContext context, final 
> String solrLocation)
> should be changed to 
> public static SolrClient createSolrClient(final PropertyContext context, 
> final String solrLocation)
> to be suitable also for controller services.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (NIFI-4583) Restructure package nifi-solr-processors

2017-12-30 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/NIFI-4583?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16306769#comment-16306769
 ] 

ASF GitHub Bot commented on NIFI-4583:
--

Github user JohannesDaniel commented on a diff in the pull request:

https://github.com/apache/nifi/pull/2285#discussion_r159122738
  
--- Diff: 
nifi-nar-bundles/nifi-solr-bundle/nifi-solr-processors/src/main/java/org/apache/nifi/processors/solr/SolrProcessor.java
 ---
@@ -34,39 +31,33 @@
 import org.apache.nifi.processor.util.StandardValidators;
 import org.apache.nifi.ssl.SSLContextService;
 import org.apache.solr.client.solrj.SolrClient;
-import org.apache.solr.client.solrj.impl.CloudSolrClient;
-import org.apache.solr.client.solrj.impl.HttpClientUtil;
-import org.apache.solr.client.solrj.impl.HttpSolrClient;
 import org.apache.solr.client.solrj.impl.Krb5HttpClientConfigurer;
-import org.apache.solr.common.params.ModifiableSolrParams;
 
-import javax.net.ssl.SSLContext;
 import javax.security.auth.login.Configuration;
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.List;
-import java.util.concurrent.TimeUnit;
 
 /**
  * A base class for processors that interact with Apache Solr.
  *
  */
 public abstract class SolrProcessor extends AbstractProcessor {
 
-public static final AllowableValue SOLR_TYPE_CLOUD = new 
AllowableValue(
-"Cloud", "Cloud", "A SolrCloud instance.");
-
-public static final AllowableValue SOLR_TYPE_STANDARD = new 
AllowableValue(
-"Standard", "Standard", "A stand-alone Solr instance.");
-
-public static final PropertyDescriptor SOLR_TYPE = new 
PropertyDescriptor
-.Builder().name("Solr Type")
-.description("The type of Solr instance, Cloud or Standard.")
-.required(true)
-.allowableValues(SOLR_TYPE_CLOUD, SOLR_TYPE_STANDARD)
-.defaultValue(SOLR_TYPE_STANDARD.getValue())
-.build();
+// make PropertyDescriptors of SolrUtils visible for classes extending 
SolrProcessor
+public static AllowableValue SOLR_TYPE_CLOUD = 
SolrUtils.SOLR_TYPE_CLOUD;
+public static AllowableValue SOLR_TYPE_STANDARD = 
SolrUtils.SOLR_TYPE_STANDARD;
+public static PropertyDescriptor SOLR_TYPE = SolrUtils.SOLR_TYPE;
+public static PropertyDescriptor COLLECTION = SolrUtils.COLLECTION;
+public static PropertyDescriptor JAAS_CLIENT_APP_NAME = 
SolrUtils.JAAS_CLIENT_APP_NAME;
+public static PropertyDescriptor SSL_CONTEXT_SERVICE = 
SolrUtils.SSL_CONTEXT_SERVICE;
+public static PropertyDescriptor SOLR_SOCKET_TIMEOUT = 
SolrUtils.SOLR_SOCKET_TIMEOUT;
+public static PropertyDescriptor SOLR_CONNECTION_TIMEOUT = 
SolrUtils.SOLR_CONNECTION_TIMEOUT;
+public static PropertyDescriptor SOLR_MAX_CONNECTIONS = 
SolrUtils.SOLR_MAX_CONNECTIONS;
+public static PropertyDescriptor SOLR_MAX_CONNECTIONS_PER_HOST = 
SolrUtils.SOLR_MAX_CONNECTIONS_PER_HOST;
+public static PropertyDescriptor ZK_CLIENT_TIMEOUT = 
SolrUtils.ZK_CLIENT_TIMEOUT;
+public static PropertyDescriptor ZK_CONNECTION_TIMEOUT = 
SolrUtils.ZK_CONNECTION_TIMEOUT;
--- End diff --

This also affects all JUnit tests for GetSolr and PutSolrContentStream. E. 
g. all lines like
runner.setProperty(GetSolr.SOLR_TYPE, GetSolr.SOLR_TYPE_CLOUD.getValue());
have to be changed...


> Restructure package nifi-solr-processors
> 
>
> Key: NIFI-4583
> URL: https://issues.apache.org/jira/browse/NIFI-4583
> Project: Apache NiFi
>  Issue Type: Improvement
>Reporter: Johannes Peter
>Assignee: Johannes Peter
>Priority: Minor
>
> Several functionalities currently implemented e. g. in GetSolr or 
> SolrProcessor should be made available for other processors or controller 
> services. A class SolrUtils should be created containing several static 
> methods. This includes the methods 
> - getRequestParams (PutSolrContentStream)
> - solrDocumentsToRecordSet (GetSolr) 
> - createSolrClient (SolrProcessor)
> and the inner class QueryResponseOutputStreamCallback (GetSolr)
> Some unit tests might be affected.
> The method declaration  
> protected SolrClient createSolrClient(final ProcessContext context, final 
> String solrLocation)
> should be changed to 
> public static SolrClient createSolrClient(final PropertyContext context, 
> final String solrLocation)
> to be suitable also for controller services.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (NIFI-4583) Restructure package nifi-solr-processors

2017-12-30 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/NIFI-4583?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16306764#comment-16306764
 ] 

ASF GitHub Bot commented on NIFI-4583:
--

Github user JohannesDaniel commented on a diff in the pull request:

https://github.com/apache/nifi/pull/2285#discussion_r159122676
  
--- Diff: 
nifi-nar-bundles/nifi-solr-bundle/nifi-solr-processors/src/main/java/org/apache/nifi/processors/solr/SolrProcessor.java
 ---
@@ -34,39 +31,33 @@
 import org.apache.nifi.processor.util.StandardValidators;
 import org.apache.nifi.ssl.SSLContextService;
 import org.apache.solr.client.solrj.SolrClient;
-import org.apache.solr.client.solrj.impl.CloudSolrClient;
-import org.apache.solr.client.solrj.impl.HttpClientUtil;
-import org.apache.solr.client.solrj.impl.HttpSolrClient;
 import org.apache.solr.client.solrj.impl.Krb5HttpClientConfigurer;
-import org.apache.solr.common.params.ModifiableSolrParams;
 
-import javax.net.ssl.SSLContext;
 import javax.security.auth.login.Configuration;
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.List;
-import java.util.concurrent.TimeUnit;
 
 /**
  * A base class for processors that interact with Apache Solr.
  *
  */
 public abstract class SolrProcessor extends AbstractProcessor {
 
-public static final AllowableValue SOLR_TYPE_CLOUD = new 
AllowableValue(
-"Cloud", "Cloud", "A SolrCloud instance.");
-
-public static final AllowableValue SOLR_TYPE_STANDARD = new 
AllowableValue(
-"Standard", "Standard", "A stand-alone Solr instance.");
-
-public static final PropertyDescriptor SOLR_TYPE = new 
PropertyDescriptor
-.Builder().name("Solr Type")
-.description("The type of Solr instance, Cloud or Standard.")
-.required(true)
-.allowableValues(SOLR_TYPE_CLOUD, SOLR_TYPE_STANDARD)
-.defaultValue(SOLR_TYPE_STANDARD.getValue())
-.build();
+// make PropertyDescriptors of SolrUtils visible for classes extending 
SolrProcessor
+public static AllowableValue SOLR_TYPE_CLOUD = 
SolrUtils.SOLR_TYPE_CLOUD;
+public static AllowableValue SOLR_TYPE_STANDARD = 
SolrUtils.SOLR_TYPE_STANDARD;
+public static PropertyDescriptor SOLR_TYPE = SolrUtils.SOLR_TYPE;
+public static PropertyDescriptor COLLECTION = SolrUtils.COLLECTION;
+public static PropertyDescriptor JAAS_CLIENT_APP_NAME = 
SolrUtils.JAAS_CLIENT_APP_NAME;
+public static PropertyDescriptor SSL_CONTEXT_SERVICE = 
SolrUtils.SSL_CONTEXT_SERVICE;
+public static PropertyDescriptor SOLR_SOCKET_TIMEOUT = 
SolrUtils.SOLR_SOCKET_TIMEOUT;
+public static PropertyDescriptor SOLR_CONNECTION_TIMEOUT = 
SolrUtils.SOLR_CONNECTION_TIMEOUT;
+public static PropertyDescriptor SOLR_MAX_CONNECTIONS = 
SolrUtils.SOLR_MAX_CONNECTIONS;
+public static PropertyDescriptor SOLR_MAX_CONNECTIONS_PER_HOST = 
SolrUtils.SOLR_MAX_CONNECTIONS_PER_HOST;
+public static PropertyDescriptor ZK_CLIENT_TIMEOUT = 
SolrUtils.ZK_CLIENT_TIMEOUT;
+public static PropertyDescriptor ZK_CONNECTION_TIMEOUT = 
SolrUtils.ZK_CONNECTION_TIMEOUT;
--- End diff --

Hi, thx for response. Changing this to static imports means that several 
PropertyDescriptors have to be imported in classes extending SolrProcessor as 
well. My idea was to add the PropertyDescriptors as values that they can be 
used in the same way they were used before. However, I can change this.


> Restructure package nifi-solr-processors
> 
>
> Key: NIFI-4583
> URL: https://issues.apache.org/jira/browse/NIFI-4583
> Project: Apache NiFi
>  Issue Type: Improvement
>Reporter: Johannes Peter
>Assignee: Johannes Peter
>Priority: Minor
>
> Several functionalities currently implemented e. g. in GetSolr or 
> SolrProcessor should be made available for other processors or controller 
> services. A class SolrUtils should be created containing several static 
> methods. This includes the methods 
> - getRequestParams (PutSolrContentStream)
> - solrDocumentsToRecordSet (GetSolr) 
> - createSolrClient (SolrProcessor)
> and the inner class QueryResponseOutputStreamCallback (GetSolr)
> Some unit tests might be affected.
> The method declaration  
> protected SolrClient createSolrClient(final ProcessContext context, final 
> String solrLocation)
> should be changed to 
> public static SolrClient createSolrClient(final PropertyContext context, 
> final String solrLocation)
> to be suitable also for controller services.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (NIFI-4583) Restructure package nifi-solr-processors

2017-12-20 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/NIFI-4583?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16299627#comment-16299627
 ] 

ASF GitHub Bot commented on NIFI-4583:
--

Github user ijokarumawak commented on a diff in the pull request:

https://github.com/apache/nifi/pull/2285#discussion_r158204839
  
--- Diff: 
nifi-nar-bundles/nifi-solr-bundle/nifi-solr-processors/src/main/java/org/apache/nifi/processors/solr/SolrProcessor.java
 ---
@@ -34,39 +31,33 @@
 import org.apache.nifi.processor.util.StandardValidators;
 import org.apache.nifi.ssl.SSLContextService;
 import org.apache.solr.client.solrj.SolrClient;
-import org.apache.solr.client.solrj.impl.CloudSolrClient;
-import org.apache.solr.client.solrj.impl.HttpClientUtil;
-import org.apache.solr.client.solrj.impl.HttpSolrClient;
 import org.apache.solr.client.solrj.impl.Krb5HttpClientConfigurer;
-import org.apache.solr.common.params.ModifiableSolrParams;
 
-import javax.net.ssl.SSLContext;
 import javax.security.auth.login.Configuration;
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.List;
-import java.util.concurrent.TimeUnit;
 
 /**
  * A base class for processors that interact with Apache Solr.
  *
  */
 public abstract class SolrProcessor extends AbstractProcessor {
 
-public static final AllowableValue SOLR_TYPE_CLOUD = new 
AllowableValue(
-"Cloud", "Cloud", "A SolrCloud instance.");
-
-public static final AllowableValue SOLR_TYPE_STANDARD = new 
AllowableValue(
-"Standard", "Standard", "A stand-alone Solr instance.");
-
-public static final PropertyDescriptor SOLR_TYPE = new 
PropertyDescriptor
-.Builder().name("Solr Type")
-.description("The type of Solr instance, Cloud or Standard.")
-.required(true)
-.allowableValues(SOLR_TYPE_CLOUD, SOLR_TYPE_STANDARD)
-.defaultValue(SOLR_TYPE_STANDARD.getValue())
-.build();
+// make PropertyDescriptors of SolrUtils visible for classes extending 
SolrProcessor
+public static AllowableValue SOLR_TYPE_CLOUD = 
SolrUtils.SOLR_TYPE_CLOUD;
+public static AllowableValue SOLR_TYPE_STANDARD = 
SolrUtils.SOLR_TYPE_STANDARD;
+public static PropertyDescriptor SOLR_TYPE = SolrUtils.SOLR_TYPE;
+public static PropertyDescriptor COLLECTION = SolrUtils.COLLECTION;
+public static PropertyDescriptor JAAS_CLIENT_APP_NAME = 
SolrUtils.JAAS_CLIENT_APP_NAME;
+public static PropertyDescriptor SSL_CONTEXT_SERVICE = 
SolrUtils.SSL_CONTEXT_SERVICE;
+public static PropertyDescriptor SOLR_SOCKET_TIMEOUT = 
SolrUtils.SOLR_SOCKET_TIMEOUT;
+public static PropertyDescriptor SOLR_CONNECTION_TIMEOUT = 
SolrUtils.SOLR_CONNECTION_TIMEOUT;
+public static PropertyDescriptor SOLR_MAX_CONNECTIONS = 
SolrUtils.SOLR_MAX_CONNECTIONS;
+public static PropertyDescriptor SOLR_MAX_CONNECTIONS_PER_HOST = 
SolrUtils.SOLR_MAX_CONNECTIONS_PER_HOST;
+public static PropertyDescriptor ZK_CLIENT_TIMEOUT = 
SolrUtils.ZK_CLIENT_TIMEOUT;
+public static PropertyDescriptor ZK_CONNECTION_TIMEOUT = 
SolrUtils.ZK_CONNECTION_TIMEOUT;
--- End diff --

Do we still need these values defined here? Static import would be enough.


> Restructure package nifi-solr-processors
> 
>
> Key: NIFI-4583
> URL: https://issues.apache.org/jira/browse/NIFI-4583
> Project: Apache NiFi
>  Issue Type: Improvement
>Reporter: Johannes Peter
>Assignee: Johannes Peter
>Priority: Minor
>
> Several functionalities currently implemented e. g. in GetSolr or 
> SolrProcessor should be made available for other processors or controller 
> services. A class SolrUtils should be created containing several static 
> methods. This includes the methods 
> - getRequestParams (PutSolrContentStream)
> - solrDocumentsToRecordSet (GetSolr) 
> - createSolrClient (SolrProcessor)
> and the inner class QueryResponseOutputStreamCallback (GetSolr)
> Some unit tests might be affected.
> The method declaration  
> protected SolrClient createSolrClient(final ProcessContext context, final 
> String solrLocation)
> should be changed to 
> public static SolrClient createSolrClient(final PropertyContext context, 
> final String solrLocation)
> to be suitable also for controller services.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (NIFI-4583) Restructure package nifi-solr-processors

2017-12-20 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/NIFI-4583?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16299628#comment-16299628
 ] 

ASF GitHub Bot commented on NIFI-4583:
--

Github user ijokarumawak commented on a diff in the pull request:

https://github.com/apache/nifi/pull/2285#discussion_r158205010
  
--- Diff: 
nifi-nar-bundles/nifi-solr-bundle/nifi-solr-processors/src/main/java/org/apache/nifi/processors/solr/SolrProcessor.java
 ---
@@ -205,47 +125,7 @@ public final void closeClient() {
  * @return an HttpSolrClient or CloudSolrClient
  */
 protected SolrClient createSolrClient(final ProcessContext context, 
final String solrLocation) {
-final Integer socketTimeout = 
context.getProperty(SOLR_SOCKET_TIMEOUT).asTimePeriod(TimeUnit.MILLISECONDS).intValue();
-final Integer connectionTimeout = 
context.getProperty(SOLR_CONNECTION_TIMEOUT).asTimePeriod(TimeUnit.MILLISECONDS).intValue();
-final Integer maxConnections = 
context.getProperty(SOLR_MAX_CONNECTIONS).asInteger();
-final Integer maxConnectionsPerHost = 
context.getProperty(SOLR_MAX_CONNECTIONS_PER_HOST).asInteger();
-final SSLContextService sslContextService = 
context.getProperty(SSL_CONTEXT_SERVICE).asControllerService(SSLContextService.class);
-final String jaasClientAppName = 
context.getProperty(JAAS_CLIENT_APP_NAME).getValue();
-
-final ModifiableSolrParams params = new ModifiableSolrParams();
-params.set(HttpClientUtil.PROP_SO_TIMEOUT, socketTimeout);
-params.set(HttpClientUtil.PROP_CONNECTION_TIMEOUT, 
connectionTimeout);
-params.set(HttpClientUtil.PROP_MAX_CONNECTIONS, maxConnections);
-params.set(HttpClientUtil.PROP_MAX_CONNECTIONS_PER_HOST, 
maxConnectionsPerHost);
-
-// has to happen before the client is created below so that 
correct configurer would be set if neeeded
-if (!StringUtils.isEmpty(jaasClientAppName)) {
-System.setProperty("solr.kerberos.jaas.appname", 
jaasClientAppName);
-HttpClientUtil.setConfigurer(new Krb5HttpClientConfigurer());
-}
-
-final HttpClient httpClient = HttpClientUtil.createClient(params);
-
-if (sslContextService != null) {
-final SSLContext sslContext = 
sslContextService.createSSLContext(SSLContextService.ClientAuth.REQUIRED);
-final SSLSocketFactory sslSocketFactory = new 
SSLSocketFactory(sslContext);
-final Scheme httpsScheme = new Scheme("https", 443, 
sslSocketFactory);
-
httpClient.getConnectionManager().getSchemeRegistry().register(httpsScheme);
-}
-
-if 
(SOLR_TYPE_STANDARD.equals(context.getProperty(SOLR_TYPE).getValue())) {
-return new HttpSolrClient(solrLocation, httpClient);
-} else {
-final String collection = 
context.getProperty(COLLECTION).evaluateAttributeExpressions().getValue();
-final Integer zkClientTimeout = 
context.getProperty(ZK_CLIENT_TIMEOUT).asTimePeriod(TimeUnit.MILLISECONDS).intValue();
-final Integer zkConnectionTimeout = 
context.getProperty(ZK_CONNECTION_TIMEOUT).asTimePeriod(TimeUnit.MILLISECONDS).intValue();
-
-CloudSolrClient cloudSolrClient = new 
CloudSolrClient(solrLocation, httpClient);
-cloudSolrClient.setDefaultCollection(collection);
-cloudSolrClient.setZkClientTimeout(zkClientTimeout);
-cloudSolrClient.setZkConnectTimeout(zkConnectionTimeout);
-return cloudSolrClient;
-}
+return SolrUtils.createSolrClient(context, solrLocation);
--- End diff --

About the static or non-static method for unit testing, this 
createSolrClient method at SolrProcessor can be overridden at test case, so 
SolrUtils can have everything as static. It looks good, sorry for the confusion.


> Restructure package nifi-solr-processors
> 
>
> Key: NIFI-4583
> URL: https://issues.apache.org/jira/browse/NIFI-4583
> Project: Apache NiFi
>  Issue Type: Improvement
>Reporter: Johannes Peter
>Assignee: Johannes Peter
>Priority: Minor
>
> Several functionalities currently implemented e. g. in GetSolr or 
> SolrProcessor should be made available for other processors or controller 
> services. A class SolrUtils should be created containing several static 
> methods. This includes the methods 
> - getRequestParams (PutSolrContentStream)
> - solrDocumentsToRecordSet (GetSolr) 
> - createSolrClient (SolrProcessor)
> and the inner class QueryResponseOutputStreamCallback (GetSolr)
> Some unit tests might be affected.
> The method declaration  
> protected 

[jira] [Commented] (NIFI-4583) Restructure package nifi-solr-processors

2017-12-03 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/NIFI-4583?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16275926#comment-16275926
 ] 

ASF GitHub Bot commented on NIFI-4583:
--

Github user JohannesDaniel commented on a diff in the pull request:

https://github.com/apache/nifi/pull/2285#discussion_r154523361
  
--- Diff: 
nifi-nar-bundles/nifi-solr-bundle/nifi-solr-processors/src/main/java/org/apache/nifi/processors/solr/SolrUtils.java
 ---
@@ -0,0 +1,202 @@
+/*
+ * 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.solr;
+
+import org.apache.commons.io.IOUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.http.client.HttpClient;
+import org.apache.http.conn.scheme.Scheme;
+import org.apache.http.conn.ssl.SSLSocketFactory;
+import org.apache.nifi.components.AllowableValue;
+import org.apache.nifi.components.PropertyDescriptor;
+import org.apache.nifi.context.PropertyContext;
+import org.apache.nifi.processor.io.OutputStreamCallback;
+import org.apache.nifi.serialization.record.ListRecordSet;
+import org.apache.nifi.serialization.record.MapRecord;
+import org.apache.nifi.serialization.record.Record;
+import org.apache.nifi.serialization.record.RecordField;
+import org.apache.nifi.serialization.record.RecordFieldType;
+import org.apache.nifi.serialization.record.RecordSchema;
+import org.apache.nifi.serialization.record.RecordSet;
+import org.apache.nifi.ssl.SSLContextService;
+import org.apache.solr.client.solrj.SolrClient;
+import org.apache.solr.client.solrj.impl.CloudSolrClient;
+import org.apache.solr.client.solrj.impl.HttpClientUtil;
+import org.apache.solr.client.solrj.impl.HttpSolrClient;
+import org.apache.solr.client.solrj.impl.Krb5HttpClientConfigurer;
+import org.apache.solr.client.solrj.response.QueryResponse;
+import org.apache.solr.client.solrj.util.ClientUtils;
+import org.apache.solr.common.SolrDocument;
+import org.apache.solr.common.SolrInputDocument;
+import org.apache.solr.common.params.ModifiableSolrParams;
+
+import javax.net.ssl.SSLContext;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.nio.charset.StandardCharsets;
+import java.util.ArrayList;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.TimeUnit;
+
+public class SolrUtils {
--- End diff --

@bbende any other comments? As soon as this pull request is merged, I can 
create a pull request for NIFI-4516


> Restructure package nifi-solr-processors
> 
>
> Key: NIFI-4583
> URL: https://issues.apache.org/jira/browse/NIFI-4583
> Project: Apache NiFi
>  Issue Type: Improvement
>Reporter: Johannes Peter
>Assignee: Johannes Peter
>Priority: Minor
>
> Several functionalities currently implemented e. g. in GetSolr or 
> SolrProcessor should be made available for other processors or controller 
> services. A class SolrUtils should be created containing several static 
> methods. This includes the methods 
> - getRequestParams (PutSolrContentStream)
> - solrDocumentsToRecordSet (GetSolr) 
> - createSolrClient (SolrProcessor)
> and the inner class QueryResponseOutputStreamCallback (GetSolr)
> Some unit tests might be affected.
> The method declaration  
> protected SolrClient createSolrClient(final ProcessContext context, final 
> String solrLocation)
> should be changed to 
> public static SolrClient createSolrClient(final PropertyContext context, 
> final String solrLocation)
> to be suitable also for controller services.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (NIFI-4583) Restructure package nifi-solr-processors

2017-11-28 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/NIFI-4583?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16268542#comment-16268542
 ] 

ASF GitHub Bot commented on NIFI-4583:
--

Github user JohannesDaniel commented on a diff in the pull request:

https://github.com/apache/nifi/pull/2285#discussion_r153454150
  
--- Diff: 
nifi-nar-bundles/nifi-solr-bundle/nifi-solr-processors/src/main/java/org/apache/nifi/processors/solr/SolrUtils.java
 ---
@@ -0,0 +1,202 @@
+/*
+ * 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.solr;
+
+import org.apache.commons.io.IOUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.http.client.HttpClient;
+import org.apache.http.conn.scheme.Scheme;
+import org.apache.http.conn.ssl.SSLSocketFactory;
+import org.apache.nifi.components.AllowableValue;
+import org.apache.nifi.components.PropertyDescriptor;
+import org.apache.nifi.context.PropertyContext;
+import org.apache.nifi.processor.io.OutputStreamCallback;
+import org.apache.nifi.serialization.record.ListRecordSet;
+import org.apache.nifi.serialization.record.MapRecord;
+import org.apache.nifi.serialization.record.Record;
+import org.apache.nifi.serialization.record.RecordField;
+import org.apache.nifi.serialization.record.RecordFieldType;
+import org.apache.nifi.serialization.record.RecordSchema;
+import org.apache.nifi.serialization.record.RecordSet;
+import org.apache.nifi.ssl.SSLContextService;
+import org.apache.solr.client.solrj.SolrClient;
+import org.apache.solr.client.solrj.impl.CloudSolrClient;
+import org.apache.solr.client.solrj.impl.HttpClientUtil;
+import org.apache.solr.client.solrj.impl.HttpSolrClient;
+import org.apache.solr.client.solrj.impl.Krb5HttpClientConfigurer;
+import org.apache.solr.client.solrj.response.QueryResponse;
+import org.apache.solr.client.solrj.util.ClientUtils;
+import org.apache.solr.common.SolrDocument;
+import org.apache.solr.common.SolrInputDocument;
+import org.apache.solr.common.params.ModifiableSolrParams;
+
+import javax.net.ssl.SSLContext;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.nio.charset.StandardCharsets;
+import java.util.ArrayList;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.TimeUnit;
+
+public class SolrUtils {
--- End diff --

Kojis idea was to define createSolrClient as non-static to facilitate 
unit-testing. I now have defined everything as static.


> Restructure package nifi-solr-processors
> 
>
> Key: NIFI-4583
> URL: https://issues.apache.org/jira/browse/NIFI-4583
> Project: Apache NiFi
>  Issue Type: Improvement
>Reporter: Johannes Peter
>Assignee: Johannes Peter
>Priority: Minor
>
> Several functionalities currently implemented e. g. in GetSolr or 
> SolrProcessor should be made available for other processors or controller 
> services. A class SolrUtils should be created containing several static 
> methods. This includes the methods 
> - getRequestParams (PutSolrContentStream)
> - solrDocumentsToRecordSet (GetSolr) 
> - createSolrClient (SolrProcessor)
> and the inner class QueryResponseOutputStreamCallback (GetSolr)
> Some unit tests might be affected.
> The method declaration  
> protected SolrClient createSolrClient(final ProcessContext context, final 
> String solrLocation)
> should be changed to 
> public static SolrClient createSolrClient(final PropertyContext context, 
> final String solrLocation)
> to be suitable also for controller services.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (NIFI-4583) Restructure package nifi-solr-processors

2017-11-27 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/NIFI-4583?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16266895#comment-16266895
 ] 

ASF GitHub Bot commented on NIFI-4583:
--

Github user bbende commented on a diff in the pull request:

https://github.com/apache/nifi/pull/2285#discussion_r153216223
  
--- Diff: 
nifi-nar-bundles/nifi-solr-bundle/nifi-solr-processors/src/main/java/org/apache/nifi/processors/solr/SolrUtils.java
 ---
@@ -0,0 +1,202 @@
+/*
+ * 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.solr;
+
+import org.apache.commons.io.IOUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.http.client.HttpClient;
+import org.apache.http.conn.scheme.Scheme;
+import org.apache.http.conn.ssl.SSLSocketFactory;
+import org.apache.nifi.components.AllowableValue;
+import org.apache.nifi.components.PropertyDescriptor;
+import org.apache.nifi.context.PropertyContext;
+import org.apache.nifi.processor.io.OutputStreamCallback;
+import org.apache.nifi.serialization.record.ListRecordSet;
+import org.apache.nifi.serialization.record.MapRecord;
+import org.apache.nifi.serialization.record.Record;
+import org.apache.nifi.serialization.record.RecordField;
+import org.apache.nifi.serialization.record.RecordFieldType;
+import org.apache.nifi.serialization.record.RecordSchema;
+import org.apache.nifi.serialization.record.RecordSet;
+import org.apache.nifi.ssl.SSLContextService;
+import org.apache.solr.client.solrj.SolrClient;
+import org.apache.solr.client.solrj.impl.CloudSolrClient;
+import org.apache.solr.client.solrj.impl.HttpClientUtil;
+import org.apache.solr.client.solrj.impl.HttpSolrClient;
+import org.apache.solr.client.solrj.impl.Krb5HttpClientConfigurer;
+import org.apache.solr.client.solrj.response.QueryResponse;
+import org.apache.solr.client.solrj.util.ClientUtils;
+import org.apache.solr.common.SolrDocument;
+import org.apache.solr.common.SolrInputDocument;
+import org.apache.solr.common.params.ModifiableSolrParams;
+
+import javax.net.ssl.SSLContext;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.nio.charset.StandardCharsets;
+import java.util.ArrayList;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.TimeUnit;
+
+public class SolrUtils {
--- End diff --

Can we move all the static property descriptors to this class, and make 
SolrUtils consist of only static variables and methods? I think that would fit 
better with other existing patterns in already in the code-base.


> Restructure package nifi-solr-processors
> 
>
> Key: NIFI-4583
> URL: https://issues.apache.org/jira/browse/NIFI-4583
> Project: Apache NiFi
>  Issue Type: Improvement
>Reporter: Johannes Peter
>Assignee: Johannes Peter
>Priority: Minor
>
> Several functionalities currently implemented e. g. in GetSolr or 
> SolrProcessor should be made available for other processors or controller 
> services. A class SolrUtils should be created containing several static 
> methods. This includes the methods 
> - getRequestParams (PutSolrContentStream)
> - solrDocumentsToRecordSet (GetSolr) 
> - createSolrClient (SolrProcessor)
> and the inner class QueryResponseOutputStreamCallback (GetSolr)
> Some unit tests might be affected.
> The method declaration  
> protected SolrClient createSolrClient(final ProcessContext context, final 
> String solrLocation)
> should be changed to 
> public static SolrClient createSolrClient(final PropertyContext context, 
> final String solrLocation)
> to be suitable also for controller services.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (NIFI-4583) Restructure package nifi-solr-processors

2017-11-21 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/NIFI-4583?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16261839#comment-16261839
 ] 

ASF GitHub Bot commented on NIFI-4583:
--

Github user JohannesDaniel commented on the issue:

https://github.com/apache/nifi/pull/2285
  
(tested both processors in local build)


> Restructure package nifi-solr-processors
> 
>
> Key: NIFI-4583
> URL: https://issues.apache.org/jira/browse/NIFI-4583
> Project: Apache NiFi
>  Issue Type: Improvement
>Reporter: Johannes Peter
>Assignee: Johannes Peter
>Priority: Minor
>
> Several functionalities currently implemented e. g. in GetSolr or 
> SolrProcessor should be made available for other processors or controller 
> services. A class SolrUtils should be created containing several static 
> methods. This includes the methods 
> - getRequestParams (PutSolrContentStream)
> - solrDocumentsToRecordSet (GetSolr) 
> - createSolrClient (SolrProcessor)
> and the inner class QueryResponseOutputStreamCallback (GetSolr)
> Some unit tests might be affected.
> The method declaration  
> protected SolrClient createSolrClient(final ProcessContext context, final 
> String solrLocation)
> should be changed to 
> public static SolrClient createSolrClient(final PropertyContext context, 
> final String solrLocation)
> to be suitable also for controller services.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (NIFI-4583) Restructure package nifi-solr-processors

2017-11-21 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/NIFI-4583?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16261825#comment-16261825
 ] 

ASF GitHub Bot commented on NIFI-4583:
--

Github user JohannesDaniel commented on the issue:

https://github.com/apache/nifi/pull/2285
  
Restructured the methods as discussed in JIRA. Additionally, I improved the 
unit tests for GetSolr


> Restructure package nifi-solr-processors
> 
>
> Key: NIFI-4583
> URL: https://issues.apache.org/jira/browse/NIFI-4583
> Project: Apache NiFi
>  Issue Type: Improvement
>Reporter: Johannes Peter
>Assignee: Johannes Peter
>Priority: Minor
>
> Several functionalities currently implemented e. g. in GetSolr or 
> SolrProcessor should be made available for other processors or controller 
> services. A class SolrUtils should be created containing several static 
> methods. This includes the methods 
> - getRequestParams (PutSolrContentStream)
> - solrDocumentsToRecordSet (GetSolr) 
> - createSolrClient (SolrProcessor)
> and the inner class QueryResponseOutputStreamCallback (GetSolr)
> Some unit tests might be affected.
> The method declaration  
> protected SolrClient createSolrClient(final ProcessContext context, final 
> String solrLocation)
> should be changed to 
> public static SolrClient createSolrClient(final PropertyContext context, 
> final String solrLocation)
> to be suitable also for controller services.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (NIFI-4583) Restructure package nifi-solr-processors

2017-11-21 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/NIFI-4583?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16261823#comment-16261823
 ] 

ASF GitHub Bot commented on NIFI-4583:
--

GitHub user JohannesDaniel opened a pull request:

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

NIFI-4583 Restructure nifi-solr-processors

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:
- [ ] Is there a JIRA ticket associated with this PR? Is it referenced 
 in the commit message?

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

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

- [ ] Is your initial contribution a single, squashed commit?

### For code changes:
- [ ] Have you ensured that the full suite of tests is executed via mvn 
-Pcontrib-check clean install at the root nifi folder?
- [ ] Have you written or updated unit tests to verify your changes?
- [ ] 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)? 
- [ ] If applicable, have you updated the LICENSE file, including the main 
LICENSE file under nifi-assembly?
- [ ] If applicable, have you updated the NOTICE file, including the main 
NOTICE file found under nifi-assembly?
- [ ] If adding new Properties, have you added .displayName in addition to 
.name (programmatic access) for each of the new properties?

### For documentation related changes:
- [ ] 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/JohannesDaniel/nifi NIFI-4583

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

https://github.com/apache/nifi/pull/2285.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 #2285


commit 9478079d1bbbec5109a01f1d50431d7f06111928
Author: U-WOODMARK\johannes.peter 
Date:   2017-11-21T15:38:18Z

NIFI-4583 Restructure nifi-solr-processors




> Restructure package nifi-solr-processors
> 
>
> Key: NIFI-4583
> URL: https://issues.apache.org/jira/browse/NIFI-4583
> Project: Apache NiFi
>  Issue Type: Improvement
>Reporter: Johannes Peter
>Assignee: Johannes Peter
>Priority: Minor
>
> Several functionalities currently implemented e. g. in GetSolr or 
> SolrProcessor should be made available for other processors or controller 
> services. A class SolrUtils should be created containing several static 
> methods. This includes the methods 
> - getRequestParams (PutSolrContentStream)
> - solrDocumentsToRecordSet (GetSolr) 
> - createSolrClient (SolrProcessor)
> and the inner class QueryResponseOutputStreamCallback (GetSolr)
> Some unit tests might be affected.
> The method declaration  
> protected SolrClient createSolrClient(final ProcessContext context, final 
> String solrLocation)
> should be changed to 
> public static SolrClient createSolrClient(final PropertyContext context, 
> final String solrLocation)
> to be suitable also for controller services.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (NIFI-4583) Restructure package nifi-solr-processors

2017-11-10 Thread Koji Kawamura (JIRA)

[ 
https://issues.apache.org/jira/browse/NIFI-4583?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16247224#comment-16247224
 ] 

Koji Kawamura commented on NIFI-4583:
-

[~jope] I presume the motivation for this is to expand Solr integration not 
only as processor but also as other type of component, such as 
ControllerService. Then I do agree with having a common place to implement 
these functionalities.

I'd suggest one thing, that is to avoid making everything as static methods. 
Some of them, 'createSolrClien' for example, would be useful if we can alter 
its behavior especially in unit testing code. Static methods in an utility 
class are hard to customize and better to be used with only simple functions.

> Restructure package nifi-solr-processors
> 
>
> Key: NIFI-4583
> URL: https://issues.apache.org/jira/browse/NIFI-4583
> Project: Apache NiFi
>  Issue Type: Improvement
>Reporter: Johannes Peter
>Assignee: Johannes Peter
>Priority: Minor
>
> Several functionalities currently implemented e. g. in GetSolr or 
> SolrProcessor should be made available for other processors or controller 
> services. A class SolrUtils should be created containing several static 
> methods. This includes the methods 
> - getRequestParams (PutSolrContentStream)
> - solrDocumentsToRecordSet (GetSolr) 
> - createSolrClient (SolrProcessor)
> and the inner class QueryResponseOutputStreamCallback (GetSolr)
> Some unit tests might be affected.
> The method declaration  
> protected SolrClient createSolrClient(final ProcessContext context, final 
> String solrLocation)
> should be changed to 
> public static SolrClient createSolrClient(final PropertyContext context, 
> final String solrLocation)
> to be suitable also for controller services.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (NIFI-4583) Restructure package nifi-solr-processors

2017-11-08 Thread Johannes Peter (JIRA)

[ 
https://issues.apache.org/jira/browse/NIFI-4583?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16244399#comment-16244399
 ] 

Johannes Peter commented on NIFI-4583:
--

[~ijokarumawak] [~bbende] Do you agree?

> Restructure package nifi-solr-processors
> 
>
> Key: NIFI-4583
> URL: https://issues.apache.org/jira/browse/NIFI-4583
> Project: Apache NiFi
>  Issue Type: Improvement
>Reporter: Johannes Peter
>Assignee: Johannes Peter
>Priority: Minor
>
> Several functionalities currently implemented e. g. in GetSolr or 
> SolrProcessor should be made available for other processors or controller 
> services. A class SolrUtils should be created containing several static 
> methods. This includes the methods 
> - getRequestParams (PutSolrContentStream)
> - solrDocumentsToRecordSet (GetSolr) 
> - createSolrClient (SolrProcessor)
> and the inner class QueryResponseOutputStreamCallback (GetSolr)
> Some unit tests might be affected.
> The method declaration  
> protected SolrClient createSolrClient(final ProcessContext context, final 
> String solrLocation)
> should be changed to 
> public static SolrClient createSolrClient(final PropertyContext context, 
> final String solrLocation)
> to be suitable also for controller services.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)