[ https://issues.apache.org/jira/browse/NIFI-4583?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=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)