MINIFI-236: Make GetFile, PutFile, TailFile, and ExecuteProcess ThreadSafe#71
MINIFI-236: Make GetFile, PutFile, TailFile, and ExecuteProcess ThreadSafe#71phrocker wants to merge 2 commits intoapache:masterfrom
Conversation
c2bb402 to
e933e39
Compare
|
reviewing |
phrocker
left a comment
There was a problem hiding this comment.
Left some requests for changes.
| } | ||
| } | ||
|
|
||
| void ProcessSession::importFrom(io::DataStream &stream, |
| target_include_directories(tests PRIVATE BEFORE "libminifi/include/provenance") | ||
| target_link_libraries(tests ${CMAKE_THREAD_LIBS_INIT} ${UUID_LIBRARIES} ${LEVELDB_LIBRARIES} ${OPENSSL_LIBRARIES} minifi yaml-cpp c-library civetweb-cpp) | ||
| add_test(NAME LibMinifiTests COMMAND tests) | ||
|
|
There was a problem hiding this comment.
Can we try and make this less duplicative?
| void penalize(std::shared_ptr<core::FlowFile> &flow); | ||
| void penalize(std::shared_ptr<core::FlowFile> &&flow); | ||
| // Import the existed file into the flow | ||
| void importFrom(io::DataStream &stream, std::shared_ptr<core::FlowFile> &&flow); |
| // perform directory listing | ||
| void performListing(std::string dir); | ||
| void performListing(std::string dir,const GetFileRequest &request); | ||
|
|
| std::shared_ptr<std::promise<T>> promise; | ||
| }; | ||
|
|
||
| template< typename T> |
There was a problem hiding this comment.
comment to remind people that && will take ownership of Worker
| std::shared_ptr<core::FlowFile> &&flow) { | ||
| std::shared_ptr<ResourceClaim> claim = std::make_shared<ResourceClaim>(); | ||
|
|
||
| int max_read = getpagesize(); |
| return (i.modifiedTime < j.modifiedTime); | ||
| } | ||
| void TailFile::checkRollOver() { | ||
| void TailFile::checkRollOver(std::string fileLocation, std::string fileName) { |
| std::shared_ptr<core::ProcessContext> contextset = std::make_shared< | ||
| core::ProcessContext>(node2, test_repo); | ||
| core::ProcessSessionFactory factory(contextset.get()); | ||
| // processor->onSchedule(contextset.get(), &factory); |
There was a problem hiding this comment.
unless this should be removed.
apiri
left a comment
There was a problem hiding this comment.
Overall things look good. I had made a few comments concerning formatting at first but preferred to just punt that to an effort for MINIFI-254. Only question I had was concerning the map usage in GetFile. Otherwise, looks good here.
| #include "processors/PutFile.h" | ||
| #include "processors/TailFile.h" | ||
| #include "processors/ListenSyslog.h" | ||
| #include "processors/ListenHTTP.h" |
There was a problem hiding this comment.
minor: can we revert this shuffling?
| * Purpose: Extracts configuration items for all components and localized them | ||
| */ | ||
| class ConfigurableComponent { | ||
| class ConfigurableComponent { |
| == org::apache::nifi::minifi::processors::LogAttribute::ProcessorName) { | ||
| processor = std::make_shared< | ||
| org::apache::nifi::minifi::processors::LogAttribute>(name, uuid); | ||
| } else if (name |
There was a problem hiding this comment.
minor: can we revert this shuffling?
| uint64_t _lastDirectoryListingTime; | ||
| std::string _fileFilter; | ||
|
|
||
| std::map<std::string,std::atomic<uint64_t>> last_listing_times_; |
There was a problem hiding this comment.
Not sure I follow the usage of the map. Presumably we only have one directory per instance as there is no input.
|
reviewed the latest commit and code looks good Verified builds in OS X 10.11, Centos 7.x, and OS X 10.12 (via #75) Will get this merged and thank you for the fixes. |
…d safe This closes apache#71. Signed-off-by: Aldrin Piri <aldrin@apache.org>
Thank you for submitting a contribution to Apache NiFi - MiNiFi C++.
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 MINIFI-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:
For documentation related changes:
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.