arpadboda commented on a change in pull request #636: Minificpp-780 - Change
GenerateFlowFile to allow 0b content FlowFiles
URL: https://github.com/apache/nifi-minifi-cpp/pull/636#discussion_r344112199
##########
File path: extensions/standard-processors/processors/GenerateFlowFile.cpp
##########
@@ -77,88 +73,67 @@ void GenerateFlowFile::initialize() {
setSupportedRelationships(relationships);
}
-void GenerateFlowFile::onTrigger(core::ProcessContext *context,
core::ProcessSession *session) {
- uint64_t batchSize = 1;
- bool uniqueFlowFile = true;
- uint64_t fileSize = 1024;
- bool textData = false;
+void generateData(std::vector<char>& data, bool textData = false) { // NOLINT
+ std::random_device rd;
+ std::mt19937 eng(rd());
+ if (textData) {
+ std::uniform_int_distribution<> distr(0, TEXT_LEN);
Review comment:
I replaced the array with a C string, so we don't need the length any more.
----------------------------------------------------------------
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