phrocker 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_r343730541
##########
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:
integer module should be 0 to n-1 inclusive, so erroneous because it's a max
index and not a length? I don't necessarily care what the hold code did but
this block does need some comments to clarify the change why it is how it is
and if the names are misleading a clarification to the reason why it was wrong
previously.
----------------------------------------------------------------
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