You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nifi.apache.org by ph...@apache.org on 2019/06/05 11:07:09 UTC

[nifi-minifi-cpp] branch master updated (969ae92 -> 7c8fe0f)

This is an automated email from the ASF dual-hosted git repository.

phrocker pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/nifi-minifi-cpp.git.


    from 969ae92  minificpp-873 Implemented.
     new 2ff7442  MINIFICPP-908 - Fix some logging issues
     new 50091bf  MINIFICPP-715 - RawSiteToSite: initiateResourceNegotiation functions returns success in case of uknown protocol
     new 7c8fe0f  MINIFICPP-909: Pass version number through CMAKE

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 cmake/DockerConfig.cmake                           |  2 +-
 docker/DockerVerify.sh                             |  3 ++-
 docker/test/integration/minifi/__init__.py         |  8 --------
 docker/test/{ => integration}/test_hash_content.py |  3 +--
 libminifi/src/ThreadedSchedulingAgent.cpp          |  2 +-
 libminifi/src/sitetosite/RawSocketProtocol.cpp     | 20 +++++++-------------
 6 files changed, 12 insertions(+), 26 deletions(-)
 rename docker/test/{ => integration}/test_hash_content.py (89%)


[nifi-minifi-cpp] 03/03: MINIFICPP-909: Pass version number through CMAKE

Posted by ph...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

phrocker pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nifi-minifi-cpp.git

commit 7c8fe0f7c6dec276099c176882df9e22f709a1a6
Author: Marc Parisi <ph...@apache.org>
AuthorDate: Tue Jun 4 12:55:50 2019 -0400

    MINIFICPP-909: Pass version number through CMAKE
    
    This closes #583.
    
    Signed-off-by: Marc Parisi <ph...@apache.org>
---
 cmake/DockerConfig.cmake                           | 2 +-
 docker/DockerVerify.sh                             | 3 ++-
 docker/test/integration/minifi/__init__.py         | 8 --------
 docker/test/{ => integration}/test_hash_content.py | 3 +--
 4 files changed, 4 insertions(+), 12 deletions(-)

diff --git a/cmake/DockerConfig.cmake b/cmake/DockerConfig.cmake
index b1ca54d..6f70e6c 100644
--- a/cmake/DockerConfig.cmake
+++ b/cmake/DockerConfig.cmake
@@ -52,4 +52,4 @@ add_custom_target(
 
 add_custom_target(
     docker-verify
-    COMMAND ${CMAKE_SOURCE_DIR}/docker/DockerVerify.sh)
+    COMMAND ${CMAKE_SOURCE_DIR}/docker/DockerVerify.sh ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH})
diff --git a/docker/DockerVerify.sh b/docker/DockerVerify.sh
index ae48e33..592de3c 100755
--- a/docker/DockerVerify.sh
+++ b/docker/DockerVerify.sh
@@ -19,6 +19,8 @@ set -e
 
 docker_dir="$( cd ${0%/*} && pwd )"
 
+export MINIFI_VERSION=$1
+
 # Create virutal environment for testing
 if [[ ! -d ./test-env-py3 ]]; then
   echo "Creating virtual environment in ./test-env-py3" 1>&2
@@ -49,7 +51,6 @@ pip install --upgrade \
 export JAVA_HOME="/usr/lib/jvm/default-jvm"
 export PATH="$PATH:/usr/lib/jvm/default-jvm/bin"
 
-export MINIFI_VERSION=0.6.0
 export PYTHONPATH="${PYTHONPATH}:${docker_dir}/test/integration"
 
 exec pytest -s -v "${docker_dir}"/test/integration
diff --git a/docker/test/integration/minifi/__init__.py b/docker/test/integration/minifi/__init__.py
index a13ba2f..d8b280b 100644
--- a/docker/test/integration/minifi/__init__.py
+++ b/docker/test/integration/minifi/__init__.py
@@ -421,20 +421,12 @@ class DebugFlow(Processor):
     def __init__(self, ):
         super(DebugFlow, self).__init__('DebugFlow')
 
-class HashAttribute(Processor):
-    def __init__(self, attributename):
-        super(HashAttribute, self).__init__('HashAttribute',
-                                           properties={'Hash Value Attribute Key': attributename},
-                                           auto_terminate=['failure'])
-
 class AttributesToJSON(Processor):
     def __init__(self, destination, attributes):
         super(AttributesToJSON, self).__init__('AttributesToJSON',
                                       properties={'Destination': destination, 'Attributes List': attributes},
                                       schedule={'scheduling period': '0 sec'},
                                       auto_terminate=['failure'])
-        
-
 class GetFile(Processor):
     def __init__(self, input_dir):
         super(GetFile, self).__init__('GetFile',
diff --git a/docker/test/test_hash_content.py b/docker/test/integration/test_hash_content.py
similarity index 89%
rename from docker/test/test_hash_content.py
rename to docker/test/integration/test_hash_content.py
index 5dab499..1482014 100644
--- a/docker/test/test_hash_content.py
+++ b/docker/test/integration/test_hash_content.py
@@ -21,8 +21,7 @@ def test_hash_invoke():
     """
     Verify sending using InvokeHTTP to a receiver using ListenHTTP.
     """
-
-    invoke_flow = (GetFile('/tmp/input') >> HashAttribute('hash') 
+    invoke_flow = (GetFile('/tmp/input') >> Processor(name='HashContent',clazz='HashContent',properties={'Hash Attribute': 'hash'},auto_terminate=['failure']) 
                    >> InvokeHTTP('http://minifi-listen:8080/contentListener', method='POST'))
 
     listen_flow = ListenHTTP(8080)  >> LogAttribute() >>  PutFile('/tmp/output')


[nifi-minifi-cpp] 01/03: MINIFICPP-908 - Fix some logging issues

Posted by ph...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

phrocker pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nifi-minifi-cpp.git

commit 2ff7442dad764283122693f9cb3c0c53f0ba3024
Author: Arpad Boda <ab...@hortonworks.com>
AuthorDate: Tue Jun 4 18:16:57 2019 +0200

    MINIFICPP-908 - Fix some logging issues
    
    This closes #582.
    
    Signed-off-by: Marc Parisi <ph...@apache.org>
---
 libminifi/src/ThreadedSchedulingAgent.cpp      | 2 +-
 libminifi/src/sitetosite/RawSocketProtocol.cpp | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/libminifi/src/ThreadedSchedulingAgent.cpp b/libminifi/src/ThreadedSchedulingAgent.cpp
index e2da4f6..88b39f3 100644
--- a/libminifi/src/ThreadedSchedulingAgent.cpp
+++ b/libminifi/src/ThreadedSchedulingAgent.cpp
@@ -63,7 +63,7 @@ void ThreadedSchedulingAgent::schedule(std::shared_ptr<core::Processor> processo
   }
 
   if (thread_pool_.isRunning(processor->getUUIDStr())) {
-    logger_->log_warn("Can not schedule threads for processor %s because there are existing threads running");
+    logger_->log_warn("Can not schedule threads for processor %s because there are existing threads running", processor->getName());
     return;
   }
 
diff --git a/libminifi/src/sitetosite/RawSocketProtocol.cpp b/libminifi/src/sitetosite/RawSocketProtocol.cpp
index 316397a..008bf91 100644
--- a/libminifi/src/sitetosite/RawSocketProtocol.cpp
+++ b/libminifi/src/sitetosite/RawSocketProtocol.cpp
@@ -384,7 +384,7 @@ bool RawSiteToSiteClient::getPeerList(std::vector<PeerStatus> &peers) {
       }
       PeerStatus status(std::make_shared<Peer>(port_id_, host, port, secure), count, true);
       peers.push_back(std::move(status));
-      logging::LOG_TRACE(logger_) << "Site2Site Peer host " << host << " port " << port << " Secure " << secure;
+      logging::LOG_TRACE(logger_) << "Site2Site Peer host " << host << " port " << port << " Secure " << std::to_string(secure);
     }
 
     tearDown();


[nifi-minifi-cpp] 02/03: MINIFICPP-715 - RawSiteToSite: initiateResourceNegotiation functions returns success in case of uknown protocol

Posted by ph...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

phrocker pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nifi-minifi-cpp.git

commit 50091bfbccab140f7051b16c06ec3a7b305899b7
Author: Arpad Boda <ab...@hortonworks.com>
AuthorDate: Tue Jun 4 14:59:39 2019 +0200

    MINIFICPP-715 - RawSiteToSite: initiateResourceNegotiation functions returns success in case of uknown protocol
    
    This closes #581.
    
    Signed-off-by: Marc Parisi <ph...@apache.org>
---
 libminifi/src/sitetosite/RawSocketProtocol.cpp | 18 ++++++------------
 1 file changed, 6 insertions(+), 12 deletions(-)

diff --git a/libminifi/src/sitetosite/RawSocketProtocol.cpp b/libminifi/src/sitetosite/RawSocketProtocol.cpp
index 008bf91..4a700c2 100644
--- a/libminifi/src/sitetosite/RawSocketProtocol.cpp
+++ b/libminifi/src/sitetosite/RawSocketProtocol.cpp
@@ -157,18 +157,15 @@ bool RawSiteToSiteClient::initiateResourceNegotiation() {
           return initiateResourceNegotiation();
         }
       }
-      ret = -1;
+      logger_->log_error("Site2Site Negotiate protocol failed to find a common version with server");
       return false;
     case NEGOTIATED_ABORT:
-      logger_->log_warn("Site2Site Negotiate protocol response ABORT");
-      ret = -1;
+      logger_->log_error("Site2Site Negotiate protocol response ABORT");
       return false;
     default:
-      logger_->log_warn("Negotiate protocol response unknown code %d", statusCode);
-      return true;
+      logger_->log_error("Negotiate protocol response unknown code %d", statusCode);
+      return false;
   }
-
-  return true;
 }
 
 bool RawSiteToSiteClient::initiateCodecResourceNegotiation() {
@@ -220,18 +217,15 @@ bool RawSiteToSiteClient::initiateCodecResourceNegotiation() {
           return initiateCodecResourceNegotiation();
         }
       }
-      ret = -1;
+      logger_->log_error("Site2Site Negotiate codec failed to find a common version with server");
       return false;
     case NEGOTIATED_ABORT:
       logger_->log_error("Site2Site Codec Negotiate response ABORT");
-      ret = -1;
       return false;
     default:
       logger_->log_error("Negotiate Codec response unknown code %d", statusCode);
-      return true;
+      return false;
   }
-
-  return true;
 }
 
 bool RawSiteToSiteClient::handShake() {