phrocker commented on a change in pull request #596: MINIFICPP-925 - Fix
TailFile hang on long lines
URL: https://github.com/apache/nifi-minifi-cpp/pull/596#discussion_r296875532
##########
File path: libminifi/src/core/ProcessSession.cpp
##########
@@ -537,63 +534,82 @@ void ProcessSession::import(std::string source, const
std::shared_ptr<core::Flow
}
}
-void ProcessSession::import(std::string source,
std::vector<std::shared_ptr<FlowFileRecord>> &flows, bool keepSource, uint64_t
offset, char inputDelimiter) {
+void ProcessSession::import(const std::string& source,
std::vector<std::shared_ptr<FlowFileRecord>> &flows, uint64_t offset, char
inputDelimiter) {
std::shared_ptr<ResourceClaim> claim;
+ std::shared_ptr<io::BaseStream> stream;
std::shared_ptr<FlowFileRecord> flowFile;
- int size = getpagesize();
- std::vector<char> charBuffer;
- charBuffer.resize(size);
+ std::vector<uint8_t> buffer(getpagesize());
try {
- // Open the input file and seek to the appropriate location.
- std::ifstream input;
- logger_->log_debug("Opening %s", source);
- input.open(source.c_str(), std::fstream::in | std::fstream::binary);
- if (input.is_open() && input.good()) {
- if (offset != 0) {
+ try {
+ std::ifstream input;
Review comment:
Ah, so the behavior of decrementing ( I think I have a comment elsewhere )
is maintained? if so you can ignore that comment. Thanks!
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services