You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by joewitt <gi...@git.apache.org> on 2016/08/16 03:20:05 UTC

[GitHub] nifi pull request #872: NIFI-2574 checkpoint commit to allow 1831 progress

GitHub user joewitt opened a pull request:

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

    NIFI-2574 checkpoint commit to allow 1831 progress

    Builds fine.  Just cannot run tests.
    
    mvn clean install -DskipTests
    
    But this lets NIFI-1831 work continue while i clean up NiFiProperties static singleton usage
    
    Will remove getInstance() method altogether and will remove BOGUS_INSTANCE and will not extend Properties

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

    $ git pull https://github.com/joewitt/incubator-nifi NIFI-2574

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

    https://github.com/apache/nifi/pull/872.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 #872
    
----
commit c3f406de785eb2dcdc1c0ab9a8b574b3ddac1f4a
Author: joewitt <jo...@apache.org>
Date:   2016-08-16T03:18:47Z

    NIFI-2574 checkpoint commit to allow 1831 progress

----


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] nifi issue #872: NIFI-2574 checkpoint commit to allow 1831 progress

Posted by joewitt <gi...@git.apache.org>.
Github user joewitt commented on the issue:

    https://github.com/apache/nifi/pull/872
  
    @alopresto ok this is now fully up to date with master, full clean build w/contrib check solid.  Standalone app and cluster up and running.  There is some gremlin there still.
    
    @markap14 can you please take a look at this PR/build it and do a simple GenerateFlowFile -> UpdateAttribute flow and let it run.  The UpdateAttribute won't pull the data from the queue and expiration won't work either.  I clearly missed something.  If you could help find the issue that would be wonderful.
    
    @alopresto I think we should get this wrapped up and merged into master and then NIFI-1831 should be safely layered from that basis.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] nifi pull request #872: NIFI-2574 checkpoint commit to allow 1831 progress

Posted by alopresto <gi...@git.apache.org>.
Github user alopresto commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/872#discussion_r75161822
  
    --- Diff: nifi-commons/nifi-hadoop-utils/src/test/java/org/apache/nifi/hadoop/TestKerberosProperties.java ---
    @@ -19,25 +19,20 @@
     import org.apache.hadoop.conf.Configuration;
     import org.apache.nifi.components.ValidationResult;
     import org.apache.nifi.logging.ComponentLog;
    -import org.apache.nifi.util.NiFiProperties;
     import org.junit.Assert;
     import org.junit.Test;
     import org.mockito.Mockito;
     
     import java.io.File;
     import java.util.List;
     
    -import static org.mockito.Mockito.when;
    -
     public class TestKerberosProperties {
     
         @Test
         public void testWithKerberosConfigFile() {
             final File file = new File("src/test/resources/krb5.conf");
    -        final NiFiProperties niFiProperties = Mockito.mock(NiFiProperties.class);
    -        when(niFiProperties.getKerberosConfigurationFile()).thenReturn(file);
     
    -        final KerberosProperties kerberosProperties = KerberosProperties.create(niFiProperties);
    +        final KerberosProperties kerberosProperties = new KerberosProperties(file);
             Assert.assertNotNull(kerberosProperties);
    --- End diff --
    
    I think there were some weird things happening during the transition from static initialization so these are sanity checks. 


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] nifi pull request #872: NIFI-2574 checkpoint commit to allow 1831 progress

Posted by alopresto <gi...@git.apache.org>.
Github user alopresto commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/872#discussion_r75161684
  
    --- Diff: nifi-commons/nifi-properties/src/main/java/org/apache/nifi/util/NiFiProperties.java ---
    @@ -29,17 +26,22 @@
     import java.nio.file.Paths;
     import java.util.ArrayList;
     import java.util.Arrays;
    +import java.util.Collections;
     import java.util.HashMap;
     import java.util.List;
     import java.util.Map;
     import java.util.Properties;
    -
    -public class NiFiProperties extends Properties {
    -
    -    private static final long serialVersionUID = 2119177359005492702L;
    -
    -    private static final Logger LOG = LoggerFactory.getLogger(NiFiProperties.class);
    -    private static NiFiProperties instance = null;
    +import java.util.Set;
    +
    +/**
    + * The NiFiProperties class holds all properties which are needed for various
    + * values to be available at runtime. It is strongly tied to the startup
    + * properties needed and is often refer to as the 'nifi.properties' file. The
    --- End diff --
    
    I fixed this in NIFI-1831 (PR 834). 


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] nifi pull request #872: NIFI-2574 checkpoint commit to allow 1831 progress

Posted by mattyb149 <gi...@git.apache.org>.
Github user mattyb149 commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/872#discussion_r74976276
  
    --- Diff: nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-security/src/test/groovy/org/apache/nifi/web/security/x509/ocsp/OcspCertificateValidatorGroovyTest.groovy ---
    @@ -65,7 +65,8 @@ public class OcspCertificateValidatorGroovyTest {
     
         @Before
         public void setUp() throws Exception {
    -        mockProperties = [getProperty: { String propertyName -> return "value_for_${propertyName}" }] as NiFiProperties
    +        mockProperties = [getProperty: { String propertyName -> return "value_for_${propertyName}"
    +            ,getPropertyKeys: { -> return ["A", "set"] as Set<String>}] as NiFiProperties
    --- End diff --
    
    Just needs a brace at the end of line 68


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] nifi pull request #872: NIFI-2574 checkpoint commit to allow 1831 progress

Posted by markap14 <gi...@git.apache.org>.
Github user markap14 commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/872#discussion_r75158697
  
    --- Diff: nifi-commons/nifi-properties/src/main/java/org/apache/nifi/util/NiFiProperties.java ---
    @@ -29,17 +26,22 @@
     import java.nio.file.Paths;
     import java.util.ArrayList;
     import java.util.Arrays;
    +import java.util.Collections;
     import java.util.HashMap;
     import java.util.List;
     import java.util.Map;
     import java.util.Properties;
    -
    -public class NiFiProperties extends Properties {
    -
    -    private static final long serialVersionUID = 2119177359005492702L;
    -
    -    private static final Logger LOG = LoggerFactory.getLogger(NiFiProperties.class);
    -    private static NiFiProperties instance = null;
    +import java.util.Set;
    +
    +/**
    + * The NiFiProperties class holds all properties which are needed for various
    + * values to be available at runtime. It is strongly tied to the startup
    + * properties needed and is often refer to as the 'nifi.properties' file. The
    --- End diff --
    
    should be "and is often referred to"


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] nifi issue #872: NIFI-2574 checkpoint commit to allow 1831 progress

Posted by alopresto <gi...@git.apache.org>.
Github user alopresto commented on the issue:

    https://github.com/apache/nifi/pull/872
  
    As of right now, I have merged these commits into [PR 834](https://github.com/apache/nifi/pull/834/commits/d4ad014cf6ba0ded6a69f3532aacf41ce0260b89) and the build compiles, checkstyle passes, and all current tests pass. 
    
    There is still substantial cleanup work to do and because of the change from `NiFiProperties.getInstance()` to using `NiFiPropertiesLoader.get()`, the integration with Spring for *web-api* still needs to occur. 
    
    Thanks for the help @joewitt . 


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] nifi pull request #872: NIFI-2574 checkpoint commit to allow 1831 progress

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

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


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] nifi issue #872: NIFI-2574 checkpoint commit to allow 1831 progress

Posted by markap14 <gi...@git.apache.org>.
Github user markap14 commented on the issue:

    https://github.com/apache/nifi/pull/872
  
    I left a couple of inline comments regarding a few typos that I noticed, but these are really not related to this PR, just things that I noticed along the way as reviewing. I'm not seeing anything wrong with the changes here. Am +1 to merge as-is


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] nifi issue #872: NIFI-2574 checkpoint commit to allow 1831 progress

Posted by alopresto <gi...@git.apache.org>.
Github user alopresto commented on the issue:

    https://github.com/apache/nifi/pull/872
  
    I checked this out, ran the build (with tests and contrib-check) and started an instance and verified the flow mentioned above. I'd like @markap14 to give a +1 before I merge it back to master though. 


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] nifi pull request #872: NIFI-2574 checkpoint commit to allow 1831 progress

Posted by markap14 <gi...@git.apache.org>.
Github user markap14 commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/872#discussion_r75158602
  
    --- Diff: nifi-commons/nifi-hadoop-utils/src/test/java/org/apache/nifi/hadoop/TestKerberosProperties.java ---
    @@ -19,25 +19,20 @@
     import org.apache.hadoop.conf.Configuration;
     import org.apache.nifi.components.ValidationResult;
     import org.apache.nifi.logging.ComponentLog;
    -import org.apache.nifi.util.NiFiProperties;
     import org.junit.Assert;
     import org.junit.Test;
     import org.mockito.Mockito;
     
     import java.io.File;
     import java.util.List;
     
    -import static org.mockito.Mockito.when;
    -
     public class TestKerberosProperties {
     
         @Test
         public void testWithKerberosConfigFile() {
             final File file = new File("src/test/resources/krb5.conf");
    -        final NiFiProperties niFiProperties = Mockito.mock(NiFiProperties.class);
    -        when(niFiProperties.getKerberosConfigurationFile()).thenReturn(file);
     
    -        final KerberosProperties kerberosProperties = KerberosProperties.create(niFiProperties);
    +        final KerberosProperties kerberosProperties = new KerberosProperties(file);
             Assert.assertNotNull(kerberosProperties);
    --- End diff --
    
    This is an odd assertion... given that it was just created using a constructor above. Same thing happens in #testWithoutKerberosConfigFile()


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] nifi pull request #872: NIFI-2574 checkpoint commit to allow 1831 progress

Posted by mattyb149 <gi...@git.apache.org>.
Github user mattyb149 commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/872#discussion_r74981298
  
    --- Diff: nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-security/src/test/groovy/org/apache/nifi/web/security/x509/ocsp/OcspCertificateValidatorGroovyTest.groovy ---
    @@ -65,7 +65,8 @@ public class OcspCertificateValidatorGroovyTest {
     
         @Before
         public void setUp() throws Exception {
    -        mockProperties = [getProperty: { String propertyName -> return "value_for_${propertyName}" }] as NiFiProperties
    +        mockProperties = [getProperty: { String propertyName -> return "value_for_${propertyName}"
    +            ,getPropertyKeys: { -> return ["A", "set"] as Set<String>}] as NiFiProperties
    --- End diff --
    
    Actually I'm getting weird errors, doesn't look like map coercion likes the getProperty method, possibly because that method is used all over Groovy meta-classes and such. This could replace the above:
    
    mockProperties = new NiFiProperties() {
                @Override
                String getProperty(String key) {
                    return 'value_for_' + key
                }
    
                @Override
                Set<String> getPropertyKeys() {
                    return ["A", "set"]
                }
            }


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] nifi issue #872: NIFI-2574 checkpoint commit to allow 1831 progress

Posted by markap14 <gi...@git.apache.org>.
Github user markap14 commented on the issue:

    https://github.com/apache/nifi/pull/872
  
    @joewitt it appears that the queue swap threshold isn't set when the Connection Builder is created/populated


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---