You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by markap14 <gi...@git.apache.org> on 2017/11/13 18:17:42 UTC

[GitHub] nifi pull request #2270: NIFI-4598: When we retrieve the 'controller' from a...

GitHub user markap14 opened a pull request:

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

    NIFI-4598: When we retrieve the 'controller' from a remote NiFi insta…

    …nce in order to determine which ports are available, cache those results for up to some configurable amount of time (default 30 secs) so that we don't constantly issue HTTP Requests to the remote nifi
    
    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-XXXX where XXXX 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/markap14/nifi NIFI-4598

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

    https://github.com/apache/nifi/pull/2270.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 #2270
    
----
commit 01aa2aaddb382a19d4b9d0908030dc6b56010a74
Author: Mark Payne <ma...@hotmail.com>
Date:   2017-11-13T18:17:18Z

    NIFI-4598: When we retrieve the 'controller' from a remote NiFi instance in order to determine which ports are available, cache those results for up to some configurable amount of time (default 30 secs) so that we don't constantly issue HTTP Requests to the remote nifi

----


---

[GitHub] nifi pull request #2270: NIFI-4598: When we retrieve the 'controller' from a...

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

    https://github.com/apache/nifi/pull/2270#discussion_r150636791
  
    --- Diff: nifi-commons/nifi-site-to-site-client/src/main/java/org/apache/nifi/remote/client/CachingRemoteGroupContentsManager.java ---
    @@ -0,0 +1,115 @@
    +/*
    + * 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.remote.client;
    +
    +import java.io.IOException;
    +import java.io.Serializable;
    +import java.util.Map;
    +import java.util.concurrent.ConcurrentHashMap;
    +import java.util.concurrent.ConcurrentMap;
    +
    +import org.apache.nifi.remote.util.SiteToSiteRestApiClient;
    +import org.apache.nifi.web.api.dto.ControllerDTO;
    +import org.slf4j.Logger;
    +import org.slf4j.LoggerFactory;
    +
    +public class CachingRemoteGroupContentsManager implements RemoteGroupContentsManager {
    --- End diff --
    
    It looks like this code is also in the API client so I'm assuming it should only exist in one place and one of them is probably left-over


---

[GitHub] nifi issue #2270: NIFI-4598: When we retrieve the 'controller' from a remote...

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

    https://github.com/apache/nifi/pull/2270
  
    Reviewing...


---

[GitHub] nifi issue #2270: NIFI-4598: When we retrieve the 'controller' from a remote...

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

    https://github.com/apache/nifi/pull/2270
  
    +1 verified the caching behavior is working as expected, will merge to master


---

[GitHub] nifi pull request #2270: NIFI-4598: When we retrieve the 'controller' from a...

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

    https://github.com/apache/nifi/pull/2270#discussion_r150637299
  
    --- Diff: nifi-commons/nifi-site-to-site-client/src/main/java/org/apache/nifi/remote/client/CachingRemoteGroupContentsManager.java ---
    @@ -0,0 +1,115 @@
    +/*
    + * 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.remote.client;
    +
    +import java.io.IOException;
    +import java.io.Serializable;
    +import java.util.Map;
    +import java.util.concurrent.ConcurrentHashMap;
    +import java.util.concurrent.ConcurrentMap;
    +
    +import org.apache.nifi.remote.util.SiteToSiteRestApiClient;
    +import org.apache.nifi.web.api.dto.ControllerDTO;
    +import org.slf4j.Logger;
    +import org.slf4j.LoggerFactory;
    +
    +public class CachingRemoteGroupContentsManager implements RemoteGroupContentsManager {
    --- End diff --
    
    D'oh! Right you are. Started implementing it in a separate class, then realized that it worked a lot more nicely to just embed the logic in the client and forgot to remove the interface & impl. Will push another commit.


---

[GitHub] nifi pull request #2270: NIFI-4598: When we retrieve the 'controller' from a...

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

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


---