You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by jdye64 <gi...@git.apache.org> on 2017/02/21 05:28:50 UTC
[GitHub] nifi-minifi-cpp pull request #52: Support for GPSD integration
GitHub user jdye64 opened a pull request:
https://github.com/apache/nifi-minifi-cpp/pull/52
Support for GPSD integration
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/jdye64/nifi-minifi-cpp MINIFI-218
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/nifi-minifi-cpp/pull/52.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 #52
----
commit c020d33f63659ed4695d65af7af478808dd9c3e1
Author: Jeremy Dyer <je...@apache.org>
Date: 2017-02-21T05:28:24Z
Support for GPSD integration
----
---
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-minifi-cpp issue #52: MINIFI-218: Support for GPSD integration
Posted by achristianson <gi...@git.apache.org>.
Github user achristianson commented on the issue:
https://github.com/apache/nifi-minifi-cpp/pull/52
Should this PR be closed? I believe we got gpsd in with another recent commit.
---
[GitHub] nifi-minifi-cpp pull request #52: MINIFI-218: Support for GPSD integration
Posted by jdye64 <gi...@git.apache.org>.
Github user jdye64 closed the pull request at:
https://github.com/apache/nifi-minifi-cpp/pull/52
---
[GitHub] nifi-minifi-cpp issue #52: MINIFI-218: Support for GPSD integration
Posted by jdye64 <gi...@git.apache.org>.
Github user jdye64 commented on the issue:
https://github.com/apache/nifi-minifi-cpp/pull/52
This poor PR has been neglected. I think that now @phrocker PR for extensions has been committed its a good time to make another pass at this and place it in that extensions format
---
[GitHub] nifi-minifi-cpp pull request #52: MINIFI-218: Support for GPSD integration
Posted by phrocker <gi...@git.apache.org>.
Github user phrocker commented on a diff in the pull request:
https://github.com/apache/nifi-minifi-cpp/pull/52#discussion_r104832401
--- Diff: libminifi/test/unit/gps/GetGPSTests.h ---
@@ -0,0 +1,37 @@
+/**
+ *
+ * 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.
+ */
+
+
+#ifndef GPS_TESTS
+#define GPS_TESTS
+#include "../../TestBase.h"
+
+#include "../ProvenanceTestHelper.h"
+#include "../Provenance.h"
+#include "../FlowFileRecord.h"
+
+
+TEST_CASE("Test GPSD Create", "[TestGPSEventRecord]"){
--- End diff --
yeah I initially approved because I wasn't sure there was a good way to test this. I didn't know about gpsfake, and would love if there was a way to roll that in.
---
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-minifi-cpp pull request #52: Support for GPSD integration
Posted by apiri <gi...@git.apache.org>.
Github user apiri commented on a diff in the pull request:
https://github.com/apache/nifi-minifi-cpp/pull/52#discussion_r102765612
--- Diff: README.md ---
@@ -110,6 +118,9 @@ $ brew install cmake \
leveldb \
ossp-uuid \
boost \ openssl
+
+# If building with GPS support
+$ brew install gps
--- End diff --
Hmm... gps doesn't show up as a package for me in brew.
```
brew search gps
bgpstream gpsbabel gpsd \u2714 gpsim osm-gps-map
Caskroom/cask/gpsdump
```
Am I overlooking something?
---
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-minifi-cpp pull request #52: Support for GPSD integration
Posted by jdye64 <gi...@git.apache.org>.
Github user jdye64 commented on a diff in the pull request:
https://github.com/apache/nifi-minifi-cpp/pull/52#discussion_r102294797
--- Diff: libminifi/include/GetGPS.h ---
@@ -0,0 +1,73 @@
+/**
+ * @file GetGPS.h
+ * GetGPS class declaration
+ *
+ * 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.
+ */
+#ifndef __GET_GPS_H__
+#define __GET_GPS_H__
+
+#include "FlowFileRecord.h"
+#include "Processor.h"
+#include "ProcessSession.h"
+
+//! GetGPS Class
+class GetGPS : public Processor
+{
+public:
+ //! Constructor
+ /*!
+ * Create a new processor
+ */
+ GetGPS(std::string name, uuid_t uuid = NULL)
+ : Processor(name, uuid)
+ {
+ _logger = Logger::getLogger();
+ _gpsdHost = "localhost";
+ _gpsdPort = "2947";
+ _gpsdWaitTime = 50000000;
+ }
+ //! Destructor
+ virtual ~GetGPS()
+ {
+ }
+ //! Processor Name
+ static const std::string ProcessorName;
+ //! Supported Properties
+ static Property GPSDHost;
+ static Property GPSDPort;
+ static Property GPSDWaitTime;
+
+ //! Supported Relationships
+ static Relationship Success;
+
+public:
+ //! OnTrigger method, implemented by NiFi GetGPS
+ virtual void onTrigger(ProcessContext *context, ProcessSession *session);
+ //! Initialize, over write by NiFi GetGPS
+ virtual void initialize(void);
+
+protected:
+
+private:
+ //! Logger
+ Logger *_logger;
--- End diff --
No, I agree with you about this. I'll change them to make them follow the google guidelines. Best to start those new habits now =)
---
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-minifi-cpp issue #52: MINIFI-218: Support for GPSD integration
Posted by phrocker <gi...@git.apache.org>.
Github user phrocker commented on the issue:
https://github.com/apache/nifi-minifi-cpp/pull/52
@jdye64 I think this PR has been superseded. I've taken your PR in 172 and updated it. This can be closed.
---
[GitHub] nifi-minifi-cpp pull request #52: Support for GPSD integration
Posted by jdye64 <gi...@git.apache.org>.
Github user jdye64 commented on a diff in the pull request:
https://github.com/apache/nifi-minifi-cpp/pull/52#discussion_r102764886
--- Diff: README.md ---
@@ -110,6 +118,9 @@ $ brew install cmake \
leveldb \
ossp-uuid \
boost \ openssl
+
+# If building with GPS support
+$ brew install gps
--- End diff --
Its actually is just gps for OS X. Its the gps.h headers and such that is needed. However it might make sense to also install gpsd so I'll add that
---
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-minifi-cpp pull request #52: Support for GPSD integration
Posted by phrocker <gi...@git.apache.org>.
Github user phrocker commented on a diff in the pull request:
https://github.com/apache/nifi-minifi-cpp/pull/52#discussion_r102284495
--- Diff: libminifi/src/gps/GetGPS.cpp ---
@@ -0,0 +1,158 @@
+/**
+ * @file GetGPS.cpp
+ * GetGPS class implementation
+ *
+ * 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.
+ */
+
+#include <vector>
+#include <queue>
+#include <map>
+#include <set>
+#include <sys/time.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <time.h>
+#include <sstream>
+#include <stdio.h>
+#include <string>
+#include <iostream>
+#include <dirent.h>
+#include <limits.h>
+#include <unistd.h>
+#include <regex>
+
+#include "TimeUtil.h"
+#include "GetGPS.h"
+#include "ProcessContext.h"
+#include "ProcessSession.h"
+
+#include <libgpsmm.h>
+
+using namespace std;
+
+const std::string GetGPS::ProcessorName("GetGPS");
+Relationship GetGPS::Success("success", "All files are routed to success");
+Property GetGPS::GPSDHost("GPSD Host", "The host running the GPSD daemon", "localhost");
+Property GetGPS::GPSDPort("GPSD Port", "The GPSD daemon port", "2947");
+Property GetGPS::GPSDWaitTime("GPSD Wait Time", "Timeout value for waiting for data from the GPSD instance", "50000000");
+void GetGPS::initialize()
+{
+ //! Set the supported properties
+ std::set<Property> properties;
+ setSupportedProperties(properties);
+ //! Set the supported relationships
+ std::set<Relationship> relationships;
+ relationships.insert(Success);
+ setSupportedRelationships(relationships);
+}
+
+void GetGPS::onTrigger(ProcessContext *context, ProcessSession *session)
+{
+ try
+ {
+
+ std::string value;
+
+ _logger->log_debug("onTrigger GetGPS");
+ if (context->getProperty(GPSDHost.getName(), value))
+ {
+ _gpsdHost = value;
+ }
+
+ if (context->getProperty(GPSDPort.getName(), value))
+ {
+ _gpsdPort = value;
+ }
+
+ if (context->getProperty(GPSDWaitTime.getName(), value))
+ {
+ Property::StringToInt(value, _gpsdWaitTime);
+ }
+
+ gpsmm gps_rec(_gpsdHost.c_str(), _gpsdPort.c_str());
+
+ if (gps_rec.stream(WATCH_ENABLE|WATCH_JSON) == NULL) {
+ _logger->log_error("No GPSD running.");
+ return;
+ }
+
+ for (;;) {
--- End diff --
Could you wait on a condition in case this processor is forced shutdown.
---
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-minifi-cpp pull request #52: Support for GPSD integration
Posted by apiri <gi...@git.apache.org>.
Github user apiri commented on a diff in the pull request:
https://github.com/apache/nifi-minifi-cpp/pull/52#discussion_r102762571
--- Diff: README.md ---
@@ -110,6 +118,9 @@ $ brew install cmake \
leveldb \
ossp-uuid \
boost \ openssl
+
+# If building with GPS support
+$ brew install gps
--- End diff --
Believe this should be gpsd
---
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-minifi-cpp pull request #52: Support for GPSD integration
Posted by jdye64 <gi...@git.apache.org>.
Github user jdye64 commented on a diff in the pull request:
https://github.com/apache/nifi-minifi-cpp/pull/52#discussion_r102758892
--- Diff: libminifi/test/unit/gps/GetGPSTests.h ---
@@ -0,0 +1,37 @@
+/**
+ *
+ * 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.
+ */
+
+
+#ifndef GPS_TESTS
+#define GPS_TESTS
+#include "../../TestBase.h"
+
+#include "../ProvenanceTestHelper.h"
+#include "../Provenance.h"
+#include "../FlowFileRecord.h"
+
+
+TEST_CASE("Test GPSD Create", "[TestGPSEventRecord]"){
--- End diff --
certainly. I'm wondering the best way to do this at the moment. I want to use gpsfake for this but thinking through the best way to do so. Using gpsfake would require another system dependency since it is an extra GPSD service itself.
---
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-minifi-cpp issue #52: MINIFI-218: Support for GPSD integration
Posted by jdye64 <gi...@git.apache.org>.
Github user jdye64 commented on the issue:
https://github.com/apache/nifi-minifi-cpp/pull/52
Sorry for the late response here folks. I'm going to close this issue because as stated it has already been taken care of elsewhere.
---
[GitHub] nifi-minifi-cpp issue #52: MINIFI-218: Support for GPSD integration
Posted by phrocker <gi...@git.apache.org>.
Github user phrocker commented on the issue:
https://github.com/apache/nifi-minifi-cpp/pull/52
@achristianson yes per the comment nine days ago.
---
[GitHub] nifi-minifi-cpp pull request #52: Support for GPSD integration
Posted by apiri <gi...@git.apache.org>.
Github user apiri commented on a diff in the pull request:
https://github.com/apache/nifi-minifi-cpp/pull/52#discussion_r102764856
--- Diff: README.md ---
@@ -91,6 +93,9 @@ $ yum install cmake \
leveldb-devel leveldb \
libuuid libuuid-devel \
boost-devel \ libssl-dev
+
+# If building with GPS support
+$ yum install libgps-devel
--- End diff --
Believe this should gpsd-devel for yum based distros
---
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-minifi-cpp pull request #52: Support for GPSD integration
Posted by jdye64 <gi...@git.apache.org>.
Github user jdye64 commented on a diff in the pull request:
https://github.com/apache/nifi-minifi-cpp/pull/52#discussion_r102844031
--- Diff: libminifi/test/unit/gps/GetGPSTests.h ---
@@ -0,0 +1,37 @@
+/**
+ *
+ * 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.
+ */
+
+
+#ifndef GPS_TESTS
+#define GPS_TESTS
+#include "../../TestBase.h"
+
+#include "../ProvenanceTestHelper.h"
+#include "../Provenance.h"
+#include "../FlowFileRecord.h"
+
+
+TEST_CASE("Test GPSD Create", "[TestGPSEventRecord]"){
--- End diff --
@apiri and @phrocker I'm leaning on you guys for recommendations around the tests here. I was planning on using http://www.catb.org/gpsd/gpsfake.html
---
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-minifi-cpp pull request #52: Support for GPSD integration
Posted by jdye64 <gi...@git.apache.org>.
Github user jdye64 commented on a diff in the pull request:
https://github.com/apache/nifi-minifi-cpp/pull/52#discussion_r102765412
--- Diff: libminifi/src/FlowController.cpp ---
@@ -289,6 +289,12 @@ Processor *FlowControllerImpl::createProcessor(std::string name, uuid_t uuid) {
return NULL;
}
+ #ifdef BUILD_GPS
--- End diff --
This was not very smart of me ... this will cause an error to be thrown that the processor of type GetGPS does not exist at runtime because the last else condition will be triggered before this. I need to move this higher up the condition before the last else.
---
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-minifi-cpp pull request #52: Support for GPSD integration
Posted by apiri <gi...@git.apache.org>.
Github user apiri commented on a diff in the pull request:
https://github.com/apache/nifi-minifi-cpp/pull/52#discussion_r102764070
--- Diff: libminifi/src/gps/GetGPS.cpp ---
@@ -0,0 +1,158 @@
+/**
+ * @file GetGPS.cpp
+ * GetGPS class implementation
+ *
+ * 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.
+ */
+
+#include <vector>
+#include <queue>
+#include <map>
+#include <set>
+#include <sys/time.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <time.h>
+#include <sstream>
+#include <stdio.h>
+#include <string>
+#include <iostream>
+#include <dirent.h>
+#include <limits.h>
+#include <unistd.h>
+#include <regex>
+
+#include "TimeUtil.h"
+#include "GetGPS.h"
+#include "ProcessContext.h"
+#include "ProcessSession.h"
+
+#include <libgpsmm.h>
--- End diff --
Having issues on OS X 10.11 with the following:
```
In file included from /Users/apiri/Development/code/nifi-minifi-cpp/libminifi/src/gps/GetGPS.cpp:43:
In file included from /usr/local/include/libgpsmm.h:12:
/usr/local/include/gps.h:1887:8: error: definition of type 'policy_t' conflicts with
typedef of the same name
struct policy_t {
^
/usr/include/mach/policy.h:79:17: note: 'policy_t' declared here
typedef int policy_t;
^
In file included from /Users/apiri/Development/code/nifi-minifi-cpp/libminifi/src/gps/GetGPS.cpp:43:
In file included from /usr/local/include/libgpsmm.h:12:
/usr/local/include/gps.h:2014:12: error: elaborated type refers to a typedef
struct policy_t policy; /* our listening policy */
^
/usr/include/mach/policy.h:79:17: note: declared here
typedef int policy_t;
^
2 errors generated.
make[2]: *** [libminifi/CMakeFiles/minifi_gps.dir/src/gps/GetGPS.cpp.o] Error 1
```
---
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-minifi-cpp issue #52: MINIFI-218: Support for GPSD integration
Posted by achristianson <gi...@git.apache.org>.
Github user achristianson commented on the issue:
https://github.com/apache/nifi-minifi-cpp/pull/52
f09ad619c6d1f85f43e66b02ecea78b78a599267 is in master
---
[GitHub] nifi-minifi-cpp pull request #52: Support for GPSD integration
Posted by apiri <gi...@git.apache.org>.
Github user apiri commented on a diff in the pull request:
https://github.com/apache/nifi-minifi-cpp/pull/52#discussion_r102753365
--- Diff: libminifi/test/unit/gps/GetGPSTests.h ---
@@ -0,0 +1,37 @@
+/**
+ *
+ * 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.
+ */
+
+
+#ifndef GPS_TESTS
+#define GPS_TESTS
+#include "../../TestBase.h"
+
+#include "../ProvenanceTestHelper.h"
+#include "../Provenance.h"
+#include "../FlowFileRecord.h"
+
+
+TEST_CASE("Test GPSD Create", "[TestGPSEventRecord]"){
--- End diff --
Would we be able to create some processor specific tests?
---
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-minifi-cpp pull request #52: Support for GPSD integration
Posted by apiri <gi...@git.apache.org>.
Github user apiri commented on a diff in the pull request:
https://github.com/apache/nifi-minifi-cpp/pull/52#discussion_r102765909
--- Diff: libminifi/test/unit/gps/GetGPSTests.h ---
@@ -0,0 +1,37 @@
+/**
+ *
+ * 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.
+ */
+
+
+#ifndef GPS_TESTS
+#define GPS_TESTS
+#include "../../TestBase.h"
+
+#include "../ProvenanceTestHelper.h"
+#include "../Provenance.h"
+#include "../FlowFileRecord.h"
+
+
+TEST_CASE("Test GPSD Create", "[TestGPSEventRecord]"){
--- End diff --
Might make sense to roll in a mocking framework? https://github.com/eranpeer/FakeIt seems similarly lightweight to catch. @phrocker any recommendations or preferences?
---
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-minifi-cpp pull request #52: Support for GPSD integration
Posted by phrocker <gi...@git.apache.org>.
Github user phrocker commented on a diff in the pull request:
https://github.com/apache/nifi-minifi-cpp/pull/52#discussion_r102284269
--- Diff: libminifi/include/GetGPS.h ---
@@ -0,0 +1,73 @@
+/**
+ * @file GetGPS.h
+ * GetGPS class declaration
+ *
+ * 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.
+ */
+#ifndef __GET_GPS_H__
+#define __GET_GPS_H__
+
+#include "FlowFileRecord.h"
+#include "Processor.h"
+#include "ProcessSession.h"
+
+//! GetGPS Class
+class GetGPS : public Processor
+{
+public:
+ //! Constructor
+ /*!
+ * Create a new processor
+ */
+ GetGPS(std::string name, uuid_t uuid = NULL)
+ : Processor(name, uuid)
+ {
+ _logger = Logger::getLogger();
+ _gpsdHost = "localhost";
+ _gpsdPort = "2947";
+ _gpsdWaitTime = 50000000;
+ }
+ //! Destructor
+ virtual ~GetGPS()
+ {
+ }
+ //! Processor Name
+ static const std::string ProcessorName;
+ //! Supported Properties
+ static Property GPSDHost;
+ static Property GPSDPort;
+ static Property GPSDWaitTime;
+
+ //! Supported Relationships
+ static Relationship Success;
+
+public:
+ //! OnTrigger method, implemented by NiFi GetGPS
+ virtual void onTrigger(ProcessContext *context, ProcessSession *session);
+ //! Initialize, over write by NiFi GetGPS
+ virtual void initialize(void);
+
+protected:
+
+private:
+ //! Logger
+ Logger *_logger;
--- End diff --
logger_ is the google cpp style guide approach. Same with all of these.
---
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-minifi-cpp issue #52: Support for GPSD integration
Posted by apiri <gi...@git.apache.org>.
Github user apiri commented on the issue:
https://github.com/apache/nifi-minifi-cpp/pull/52
Could we also get travis updated to include this in the build by default?
---
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.
---