MINIFICPP-1203 fix whitespaces around comments, remove redundant comments
Script used to correct linter reported missing space between // and comment:
make linter |& egrep -v '^Done processing|^Ignoring' | grep "Should have a space between // and comment" | tr ":" " " | cut -d" " -f1,2 | sort -rn -k1 -k2 | xargs -n 2 sh -c 'sed -i "" "$2s;//;// ;" $1' sh
Script used to correct linter missing whitepaces between code and comments:
make linter |& egrep -v '^Done processing|^Ignoring' | grep "At least two spaces is best between code and comments" | tr ":" " " | cut -d" " -f1,2 | sort -rn -k1 -k2 | xargs -n 2 sh -c 'sed -i "" "$2s;//; //;" $1 && sed -i "" "$2s; //; //;" $1' sh
Signed-off-by: Marton Szasz <szaszm01@gmail.com>
This closes #884
diff --git a/extensions/aws/AWSLoader.h b/extensions/aws/AWSLoader.h
index 9f05206..497ffee 100644
--- a/extensions/aws/AWSLoader.h
+++ b/extensions/aws/AWSLoader.h
@@ -65,4 +65,4 @@
DLL_EXPORT void *createAWSFactory(void);
}
-#endif //NIFI_MINIFI_CPP_AWSLOADER_H
+#endif // NIFI_MINIFI_CPP_AWSLOADER_H
diff --git a/extensions/aws/controllerservices/AWSCredentialsService.h b/extensions/aws/controllerservices/AWSCredentialsService.h
index a9cb69d..987b30f 100644
--- a/extensions/aws/controllerservices/AWSCredentialsService.h
+++ b/extensions/aws/controllerservices/AWSCredentialsService.h
@@ -101,4 +101,4 @@
} /* namespace apache */
} /* namespace org */
-#endif //NIFI_MINIFI_CPP_AWSCREDENTIALSCONTROLLERSERVICE_H
+#endif // NIFI_MINIFI_CPP_AWSCREDENTIALSCONTROLLERSERVICE_H
diff --git a/extensions/civetweb/tests/ListenHTTPTests.cpp b/extensions/civetweb/tests/ListenHTTPTests.cpp
index 89699be..df6a324 100644
--- a/extensions/civetweb/tests/ListenHTTPTests.cpp
+++ b/extensions/civetweb/tests/ListenHTTPTests.cpp
@@ -110,9 +110,9 @@
}
void run_server() {
- plan->runNextProcessor(); // GetFile
- plan->runNextProcessor(); // UpdateAttribute
- plan->runNextProcessor(); // ListenHTTP
+ plan->runNextProcessor(); // GetFile
+ plan->runNextProcessor(); // UpdateAttribute
+ plan->runNextProcessor(); // ListenHTTP
auto raw_ptr = dynamic_cast<org::apache::nifi::minifi::processors::ListenHTTP*>(listen_http.get());
std::string protocol = std::string("http") + (raw_ptr->isSecure() ? "s" : "");
@@ -158,7 +158,7 @@
REQUIRE("" == response_body);
}
- plan->runNextProcessor(); // LogAttribute
+ plan->runNextProcessor(); // LogAttribute
REQUIRE(LogTestController::getInstance().contains("Size:" + std::to_string(payload.size()) + " Offset:0"));
}
}
diff --git a/extensions/coap/server/CoapServer.h b/extensions/coap/server/CoapServer.h
index ecb2ebd..8c52190 100644
--- a/extensions/coap/server/CoapServer.h
+++ b/extensions/coap/server/CoapServer.h
@@ -103,8 +103,8 @@
: core::Connectable(name, uuid),
server_(nullptr),
port_(0) {
- //TODO: this allows this class to be instantiated via the the class loader
- //need to define this capability in the future.
+ // TODO: this allows this class to be instantiated via the the class loader
+ // need to define this capability in the future.
}
CoapServer(const std::string &hostname, uint16_t port)
: core::Connectable(hostname),
diff --git a/extensions/expression-language/common/Value.h b/extensions/expression-language/common/Value.h
index bc29f68..1cb2e5e 100644
--- a/extensions/expression-language/common/Value.h
+++ b/extensions/expression-language/common/Value.h
@@ -261,4 +261,4 @@
} /* namespace apache */
} /* namespace org */
-#endif //NIFI_MINIFI_CPP_VALUE_H
+#endif // NIFI_MINIFI_CPP_VALUE_H
diff --git a/extensions/gps/GetGPS.cpp b/extensions/gps/GetGPS.cpp
index 484a412..66c8627 100644
--- a/extensions/gps/GetGPS.cpp
+++ b/extensions/gps/GetGPS.cpp
@@ -140,7 +140,7 @@
session->transfer(flowFile, Success);
- //Break the for(;;) waiting loop
+ // Break the for(;;) waiting loop
break;
} else {
logger_->log_info("Satellite lock has not yet been acquired");
diff --git a/extensions/http-curl/client/HTTPClient.cpp b/extensions/http-curl/client/HTTPClient.cpp
index 5d48a9a..542fdaa 100644
--- a/extensions/http-curl/client/HTTPClient.cpp
+++ b/extensions/http-curl/client/HTTPClient.cpp
@@ -383,7 +383,7 @@
logger_->log_debug("Using certificate file \"%s\"", ssl_context_service_->getCertificateFile());
logger_->log_debug("Using private key file \"%s\"", ssl_context_service_->getPrivateKeyFile());
logger_->log_debug("Using CA certificate file \"%s\"", ssl_context_service_->getCACertificate());
-#if 0 // Reenable this path once we change from the direct manipulation of the SSL context to using the cURL API
+#if 0 // Reenable this path once we change from the direct manipulation of the SSL context to using the cURL API
if (!ssl_context_service_->getCertificateFile().empty()) {
if (utils::StringUtils::endsWithIgnoreCase(ssl_context_service_->getCertificateFile(),"p12")) {
curl_easy_setopt(http_session, CURLOPT_SSLCERTTYPE, "P12");
diff --git a/extensions/http-curl/sitetosite/HTTPProtocol.h b/extensions/http-curl/sitetosite/HTTPProtocol.h
index b75b69c..7b1e790 100644
--- a/extensions/http-curl/sitetosite/HTTPProtocol.h
+++ b/extensions/http-curl/sitetosite/HTTPProtocol.h
@@ -101,7 +101,7 @@
virtual std::shared_ptr<Transaction> createTransaction(std::string &transactionID, TransferDirection direction) override;
// Transfer flow files for the process session
- //virtual bool transferFlowFiles(const std::shared_ptr<core::ProcessContext> &context, const std::shared_ptr<core::ProcessSession> &session);
+ // virtual bool transferFlowFiles(const std::shared_ptr<core::ProcessContext> &context, const std::shared_ptr<core::ProcessSession> &session);
//! Transfer string for the process session
virtual bool transmitPayload(const std::shared_ptr<core::ProcessContext> &context, const std::shared_ptr<core::ProcessSession> &session, const std::string &payload,
std::map<std::string, std::string> attributes) override;
diff --git a/extensions/http-curl/tests/CivetStream.h b/extensions/http-curl/tests/CivetStream.h
index d096112..fb33eec 100644
--- a/extensions/http-curl/tests/CivetStream.h
+++ b/extensions/http-curl/tests/CivetStream.h
@@ -119,7 +119,6 @@
return readData(reinterpret_cast<uint8_t *>(&buf[0]), sizeof(t));
}
- //size_t pos;
struct mg_connection *conn;
private:
diff --git a/extensions/http-curl/tests/HTTPHandlers.h b/extensions/http-curl/tests/HTTPHandlers.h
index 3586b9a..4583f8c 100644
--- a/extensions/http-curl/tests/HTTPHandlers.h
+++ b/extensions/http-curl/tests/HTTPHandlers.h
@@ -428,7 +428,6 @@
void verify(struct mg_connection *conn) {
auto post_data = readPayload(conn);
- //std::cerr << post_data << std::endl;
if (!IsNullOrEmpty(post_data)) {
rapidjson::Document root;
rapidjson::ParseResult ok = root.Parse(post_data.data(), post_data.size());
diff --git a/extensions/http-curl/tests/ServerAwareHandler.h b/extensions/http-curl/tests/ServerAwareHandler.h
index bb88c2f..8aaaf75 100644
--- a/extensions/http-curl/tests/ServerAwareHandler.h
+++ b/extensions/http-curl/tests/ServerAwareHandler.h
@@ -42,4 +42,4 @@
std::atomic_bool terminate_{false};
};
-#endif //NIFI_MINIFI_CPP_SERVERAWAREHANDLER_H
+#endif // NIFI_MINIFI_CPP_SERVERAWAREHANDLER_H
diff --git a/extensions/jni/JNIUtil.h b/extensions/jni/JNIUtil.h
index 788ff2a..a8240c6 100644
--- a/extensions/jni/JNIUtil.h
+++ b/extensions/jni/JNIUtil.h
@@ -35,4 +35,4 @@
return str;
}
-#endif //NIFI_MINIFI_CPP_JNIUTIL_H
+#endif // NIFI_MINIFI_CPP_JNIUTIL_H
diff --git a/extensions/jni/jvm/JVMLoader.h b/extensions/jni/jvm/JVMLoader.h
index 943006f..cb6f3a8 100644
--- a/extensions/jni/jvm/JVMLoader.h
+++ b/extensions/jni/jvm/JVMLoader.h
@@ -325,7 +325,7 @@
current_error_ = std::string(messageBuffer, size);
- //Free the buffer.
+ // Free the buffer.
LocalFree(messageBuffer);
}
diff --git a/extensions/jni/jvm/JniProcessContext.h b/extensions/jni/jvm/JniProcessContext.h
index 06a79a2..1196d7b 100644
--- a/extensions/jni/jvm/JniProcessContext.h
+++ b/extensions/jni/jvm/JniProcessContext.h
@@ -69,9 +69,6 @@
DLL_EXPORT jobject JNICALL Java_org_apache_nifi_processor_JniProcessContext_getControllerServiceLookup(JNIEnv *env, jobject obj);
-//getname
-//getControllerservicelookup
-
#ifdef __cplusplus
}
#endif
diff --git a/extensions/jni/jvm/JniProcessSession.cpp b/extensions/jni/jvm/JniProcessSession.cpp
index 36cbb73..a6a780d 100644
--- a/extensions/jni/jvm/JniProcessSession.cpp
+++ b/extensions/jni/jvm/JniProcessSession.cpp
@@ -231,7 +231,7 @@
auto resValue = JniStringToUTF(env, value);
if (!ptr->get()->addAttribute(resKey, resValue)) {
- if (resKey != "uuid") { // don't update the keyed attribute uuid
+ if (resKey != "uuid") { // don't update the keyed attribute uuid
ptr->get()->updateAttribute(resKey, resValue);
}
}
diff --git a/extensions/libarchive/FocusArchiveEntry.cpp b/extensions/libarchive/FocusArchiveEntry.cpp
index 1465ba1..9888c87 100644
--- a/extensions/libarchive/FocusArchiveEntry.cpp
+++ b/extensions/libarchive/FocusArchiveEntry.cpp
@@ -130,7 +130,6 @@
}
archiveStack.push(archiveMetadata);
- //logger_->log_debug(archiveMetadata.toJsonString());
std::string stackStr = archiveStack.toJsonString();
diff --git a/extensions/libarchive/MergeContent.h b/extensions/libarchive/MergeContent.h
index 29ca2a3..32475a1 100644
--- a/extensions/libarchive/MergeContent.h
+++ b/extensions/libarchive/MergeContent.h
@@ -202,10 +202,10 @@
arch = archive_write_new();
if (merge_type_ == merge_content_options::MERGE_FORMAT_TAR_VALUE) {
- archive_write_set_format_pax_restricted(arch); // tar format
+ archive_write_set_format_pax_restricted(arch); // tar format
}
if (merge_type_ == merge_content_options::MERGE_FORMAT_ZIP_VALUE) {
- archive_write_set_format_zip(arch); // zip format
+ archive_write_set_format_zip(arch); // zip format
}
archive_write_set_bytes_per_block(arch, 0);
archive_write_add_filter_none(arch);
diff --git a/extensions/mqtt/protocol/MQTTC2Protocol.h b/extensions/mqtt/protocol/MQTTC2Protocol.h
index 1497b10..917d136 100644
--- a/extensions/mqtt/protocol/MQTTC2Protocol.h
+++ b/extensions/mqtt/protocol/MQTTC2Protocol.h
@@ -83,7 +83,7 @@
// mqtt controller service reference.
std::shared_ptr<controllers::MQTTControllerService> mqtt_service_;
std::shared_ptr<logging::Logger> logger_;
- //mqtt controller serviec name.
+ // mqtt controller serviec name.
std::string controller_service_name_;
diff --git a/extensions/opc/include/fetchopc.h b/extensions/opc/include/fetchopc.h
index b4377f8..e8ff90c 100644
--- a/extensions/opc/include/fetchopc.h
+++ b/extensions/opc/include/fetchopc.h
@@ -97,7 +97,7 @@
private:
std::mutex onTriggerMutex_;
std::vector<UA_NodeId> translatedNodeIDs_; // Only used when user provides path, path->nodeid translation is only done once
- std::unordered_map<std::string, std::string> node_timestamp_; // Key = Full path, Value = Timestamp
+ std::unordered_map<std::string, std::string> node_timestamp_; // Key = Full path, Value = Timestamp
};
@@ -109,4 +109,4 @@
} /* namespace apache */
} /* namespace org */
-#endif //NIFI_MINIFI_CPP_FetchOPCProcessor_H
+#endif // NIFI_MINIFI_CPP_FetchOPCProcessor_H
diff --git a/extensions/opc/include/opc.h b/extensions/opc/include/opc.h
index 907a847..3eba077 100644
--- a/extensions/opc/include/opc.h
+++ b/extensions/opc/include/opc.h
@@ -143,4 +143,4 @@
} /* namespace org */
-#endif //NIFI_MINIFI_CPP_OPC_H
+#endif // NIFI_MINIFI_CPP_OPC_H
diff --git a/extensions/opc/include/opcbase.h b/extensions/opc/include/opcbase.h
index 897f75c..ecd49b9 100644
--- a/extensions/opc/include/opcbase.h
+++ b/extensions/opc/include/opcbase.h
@@ -80,4 +80,4 @@
} /* namespace apache */
} /* namespace org */
-#endif //NIFI_MINIFI_CPP_OPCBASE_H
+#endif // NIFI_MINIFI_CPP_OPCBASE_H
diff --git a/extensions/opc/src/opc.cpp b/extensions/opc/src/opc.cpp
index f687740..d27afdc 100644
--- a/extensions/opc/src/opc.cpp
+++ b/extensions/opc/src/opc.cpp
@@ -15,17 +15,17 @@
* limitations under the License.
*/
-//OPC includes
+// OPC includes
#include "opc.h"
-//MiNiFi includes
+// MiNiFi includes
#include "utils/StringUtils.h"
#include "logging/Logger.h"
#include "Exception.h"
#include "utils/gsl.h"
-//Standard includes
+// Standard includes
#include <stdlib.h>
#include <iostream>
#include <memory>
diff --git a/extensions/opencv/CaptureRTSPFrame.h b/extensions/opencv/CaptureRTSPFrame.h
index 537d672..5253f23 100644
--- a/extensions/opencv/CaptureRTSPFrame.h
+++ b/extensions/opencv/CaptureRTSPFrame.h
@@ -140,4 +140,4 @@
} /* namespace org */
-#endif //NIFI_MINIFI_CPP_CAPTURERTSPFRAME_H
+#endif // NIFI_MINIFI_CPP_CAPTURERTSPFRAME_H
diff --git a/extensions/opencv/FrameIO.h b/extensions/opencv/FrameIO.h
index 8009afa..3359be9 100644
--- a/extensions/opencv/FrameIO.h
+++ b/extensions/opencv/FrameIO.h
@@ -74,4 +74,4 @@
} /* namespace apache */
} /* namespace org */
-#endif //NIFI_MINIFI_CPP_FRAMEIO_H
+#endif // NIFI_MINIFI_CPP_FRAMEIO_H
diff --git a/extensions/opencv/MotionDetector.h b/extensions/opencv/MotionDetector.h
index 4acafb8..9987b9d 100644
--- a/extensions/opencv/MotionDetector.h
+++ b/extensions/opencv/MotionDetector.h
@@ -85,4 +85,4 @@
} /* namespace apache */
} /* namespace org */
-#endif //NIFI_MINIFI_CPP_MOTIONDETECTOR_H
+#endif // NIFI_MINIFI_CPP_MOTIONDETECTOR_H
diff --git a/extensions/openwsman/processors/SourceInitiatedSubscriptionListener.h b/extensions/openwsman/processors/SourceInitiatedSubscriptionListener.h
index 70ef004..d884e3e 100644
--- a/extensions/openwsman/processors/SourceInitiatedSubscriptionListener.h
+++ b/extensions/openwsman/processors/SourceInitiatedSubscriptionListener.h
@@ -170,4 +170,4 @@
} /* namespace apache */
} /* namespace org */
-#endif // __SOURCE_INITIATED_SUBSCRIPTION_PROCESSOR_H__
+#endif // __SOURCE_INITIATED_SUBSCRIPTION_PROCESSOR_H__
diff --git a/extensions/rocksdb-repos/FlowFileRepository.h b/extensions/rocksdb-repos/FlowFileRepository.h
index 20581d4..b3cfc2b 100644
--- a/extensions/rocksdb-repos/FlowFileRepository.h
+++ b/extensions/rocksdb-repos/FlowFileRepository.h
@@ -44,9 +44,9 @@
#define FLOWFILE_REPOSITORY_DIRECTORY "./flowfile_repository"
#define FLOWFILE_CHECKPOINT_DIRECTORY "./flowfile_checkpoint"
#endif
-#define MAX_FLOWFILE_REPOSITORY_STORAGE_SIZE (10*1024*1024) // 10M
-#define MAX_FLOWFILE_REPOSITORY_ENTRY_LIFE_TIME (600000) // 10 minute
-#define FLOWFILE_REPOSITORY_PURGE_PERIOD (2000) // 2000 msec
+#define MAX_FLOWFILE_REPOSITORY_STORAGE_SIZE (10*1024*1024) // 10M
+#define MAX_FLOWFILE_REPOSITORY_ENTRY_LIFE_TIME (600000) // 10 minute
+#define FLOWFILE_REPOSITORY_PURGE_PERIOD (2000) // 2000 msec
#define FLOWFILE_REPOSITORY_RETRY_INTERVAL_INCREMENTS (500) // msec
/**
diff --git a/extensions/rocksdb-repos/ProvenanceRepository.h b/extensions/rocksdb-repos/ProvenanceRepository.h
index 87728ef..5b5f788 100644
--- a/extensions/rocksdb-repos/ProvenanceRepository.h
+++ b/extensions/rocksdb-repos/ProvenanceRepository.h
@@ -31,9 +31,9 @@
namespace provenance {
#define PROVENANCE_DIRECTORY "./provenance_repository"
-#define MAX_PROVENANCE_STORAGE_SIZE (10*1024*1024) // 10M
-#define MAX_PROVENANCE_ENTRY_LIFE_TIME (60000) // 1 minute
-#define PROVENANCE_PURGE_PERIOD (2500) // 2500 msec
+#define MAX_PROVENANCE_STORAGE_SIZE (10*1024*1024) // 10M
+#define MAX_PROVENANCE_ENTRY_LIFE_TIME (60000) // 1 minute
+#define PROVENANCE_PURGE_PERIOD (2500) // 2500 msec
class ProvenanceRepository : public core::Repository, public std::enable_shared_from_this<ProvenanceRepository> {
public:
diff --git a/extensions/script/ExecuteScript.h b/extensions/script/ExecuteScript.h
index 0a81b6c..c0bdd4e 100644
--- a/extensions/script/ExecuteScript.h
+++ b/extensions/script/ExecuteScript.h
@@ -100,4 +100,4 @@
} /* namespace apache */
} /* namespace org */
-#endif //NIFI_MINIFI_CPP_EXECUTESCRIPT_H
+#endif // NIFI_MINIFI_CPP_EXECUTESCRIPT_H
diff --git a/extensions/script/ScriptEngine.h b/extensions/script/ScriptEngine.h
index 5a41414..ae0125e 100644
--- a/extensions/script/ScriptEngine.h
+++ b/extensions/script/ScriptEngine.h
@@ -49,4 +49,4 @@
} /* namespace apache */
} /* namespace org */
-#endif //NIFI_MINIFI_CPP_SCRIPTENGINE_H
+#endif // NIFI_MINIFI_CPP_SCRIPTENGINE_H
diff --git a/extensions/script/ScriptFlowFile.h b/extensions/script/ScriptFlowFile.h
index fbbae49..f442190 100644
--- a/extensions/script/ScriptFlowFile.h
+++ b/extensions/script/ScriptFlowFile.h
@@ -47,4 +47,4 @@
} /* namespace apache */
} /* namespace org */
-#endif //NIFI_MINIFI_CPP_SCRIPTFLOWFILE_H
+#endif // NIFI_MINIFI_CPP_SCRIPTFLOWFILE_H
diff --git a/extensions/script/ScriptProcessContext.h b/extensions/script/ScriptProcessContext.h
index 3a92c26..7921ff1 100644
--- a/extensions/script/ScriptProcessContext.h
+++ b/extensions/script/ScriptProcessContext.h
@@ -46,4 +46,4 @@
} /* namespace apache */
} /* namespace org */
-#endif //NIFI_MINIFI_CPP_PYPROCESSCONTEXT_H
+#endif // NIFI_MINIFI_CPP_PYPROCESSCONTEXT_H
diff --git a/extensions/script/lua/LuaBaseStream.h b/extensions/script/lua/LuaBaseStream.h
index fb19e08..a57f219 100644
--- a/extensions/script/lua/LuaBaseStream.h
+++ b/extensions/script/lua/LuaBaseStream.h
@@ -55,4 +55,4 @@
} /* namespace apache */
} /* namespace org */
-#endif //NIFI_MINIFI_CPP_LUABASESTREAM_H
+#endif // NIFI_MINIFI_CPP_LUABASESTREAM_H
diff --git a/extensions/script/lua/LuaProcessSession.h b/extensions/script/lua/LuaProcessSession.h
index 535f91b..f0cbb4f 100644
--- a/extensions/script/lua/LuaProcessSession.h
+++ b/extensions/script/lua/LuaProcessSession.h
@@ -96,4 +96,4 @@
} /* namespace apache */
} /* namespace org */
-#endif //NIFI_MINIFI_CPP_LUAPROCESSSESSION_H
+#endif // NIFI_MINIFI_CPP_LUAPROCESSSESSION_H
diff --git a/extensions/script/lua/LuaScriptEngine.h b/extensions/script/lua/LuaScriptEngine.h
index 82f4ba7..13ebc5f 100644
--- a/extensions/script/lua/LuaScriptEngine.h
+++ b/extensions/script/lua/LuaScriptEngine.h
@@ -106,4 +106,4 @@
} /* namespace apache */
} /* namespace org */
-#endif //NIFI_MINIFI_CPP_LUASCRIPTENGINE_H
+#endif // NIFI_MINIFI_CPP_LUASCRIPTENGINE_H
diff --git a/extensions/script/python/PyBaseStream.h b/extensions/script/python/PyBaseStream.h
index 475d50a..f07fe80 100644
--- a/extensions/script/python/PyBaseStream.h
+++ b/extensions/script/python/PyBaseStream.h
@@ -49,4 +49,4 @@
} /* namespace apache */
} /* namespace org */
-#endif //NIFI_MINIFI_CPP_PYBYTESTREAM_H
+#endif // NIFI_MINIFI_CPP_PYBYTESTREAM_H
diff --git a/extensions/script/python/PyProcessSession.h b/extensions/script/python/PyProcessSession.h
index d418a66..00bad31 100644
--- a/extensions/script/python/PyProcessSession.h
+++ b/extensions/script/python/PyProcessSession.h
@@ -101,4 +101,4 @@
#pragma GCC visibility pop
-#endif //NIFI_MINIFI_CPP_PYPROCESSESSION_H
+#endif // NIFI_MINIFI_CPP_PYPROCESSESSION_H
diff --git a/extensions/script/python/PythonBindings.h b/extensions/script/python/PythonBindings.h
index 8dda7ad..af04c9f 100644
--- a/extensions/script/python/PythonBindings.h
+++ b/extensions/script/python/PythonBindings.h
@@ -80,4 +80,4 @@
.def("write", &python::PyBaseStream::write);
}
-#endif //NIFI_MINIFI_CPP_PYTHONBINDINGS_H
+#endif // NIFI_MINIFI_CPP_PYTHONBINDINGS_H
diff --git a/extensions/script/python/PythonProcessor.h b/extensions/script/python/PythonProcessor.h
index 5cfdaeb..a86d703 100644
--- a/extensions/script/python/PythonProcessor.h
+++ b/extensions/script/python/PythonProcessor.h
@@ -68,4 +68,4 @@
} /* namespace apache */
} /* namespace org */
-#endif //NIFI_MINIFI_CPP_PYTHONPROCESSOR_H
+#endif // NIFI_MINIFI_CPP_PYTHONPROCESSOR_H
diff --git a/extensions/script/python/PythonScriptEngine.h b/extensions/script/python/PythonScriptEngine.h
index 7a1b466..bf5dcc0 100644
--- a/extensions/script/python/PythonScriptEngine.h
+++ b/extensions/script/python/PythonScriptEngine.h
@@ -237,4 +237,4 @@
#pragma GCC visibility pop
-#endif //NIFI_MINIFI_CPP_PYTHONSCRIPTENGINE_H
+#endif // NIFI_MINIFI_CPP_PYTHONSCRIPTENGINE_H
diff --git a/extensions/sftp/tests/FetchSFTPTests.cpp b/extensions/sftp/tests/FetchSFTPTests.cpp
index 89fea7c..14c33b5 100644
--- a/extensions/sftp/tests/FetchSFTPTests.cpp
+++ b/extensions/sftp/tests/FetchSFTPTests.cpp
@@ -142,7 +142,7 @@
std::fstream file;
std::stringstream ss;
ss << src_dir << "/vfs/" << relative_path;
- utils::file::FileUtils::create_dir(utils::file::FileUtils::get_parent_path(ss.str())); // TODO
+ utils::file::FileUtils::create_dir(utils::file::FileUtils::get_parent_path(ss.str())); // TODO
file.open(ss.str(), std::ios::out);
file << content;
file.close();
diff --git a/extensions/sqlite/ExecuteSQL.h b/extensions/sqlite/ExecuteSQL.h
index 2f7d55e..58a53a3 100644
--- a/extensions/sqlite/ExecuteSQL.h
+++ b/extensions/sqlite/ExecuteSQL.h
@@ -83,4 +83,4 @@
} /* namespace apache */
} /* namespace org */
-#endif //NIFI_MINIFI_CPP_EXECUTESQL_H
+#endif // NIFI_MINIFI_CPP_EXECUTESQL_H
diff --git a/extensions/sqlite/PutSQL.h b/extensions/sqlite/PutSQL.h
index abf9178..77d5aab 100644
--- a/extensions/sqlite/PutSQL.h
+++ b/extensions/sqlite/PutSQL.h
@@ -85,4 +85,4 @@
} /* namespace apache */
} /* namespace org */
-#endif //NIFI_MINIFI_CPP_PUTSQL_H
+#endif // NIFI_MINIFI_CPP_PUTSQL_H
diff --git a/extensions/sqlite/SQLiteConnection.h b/extensions/sqlite/SQLiteConnection.h
index 0b6e325..266d729 100644
--- a/extensions/sqlite/SQLiteConnection.h
+++ b/extensions/sqlite/SQLiteConnection.h
@@ -267,4 +267,4 @@
} /* namespace apache */
} /* namespace org */
-#endif //NIFI_MINIFI_CPP_SQLITECONNECTION_H
+#endif // NIFI_MINIFI_CPP_SQLITECONNECTION_H
diff --git a/extensions/tensorflow/TFApplyGraph.h b/extensions/tensorflow/TFApplyGraph.h
index 33fe7d1..3155b05 100644
--- a/extensions/tensorflow/TFApplyGraph.h
+++ b/extensions/tensorflow/TFApplyGraph.h
@@ -114,4 +114,4 @@
} /* namespace apache */
} /* namespace org */
-#endif //NIFI_MINIFI_CPP_TFAPPLYGRAPH_H
+#endif // NIFI_MINIFI_CPP_TFAPPLYGRAPH_H
diff --git a/extensions/tensorflow/TFConvertImageToTensor.h b/extensions/tensorflow/TFConvertImageToTensor.h
index e65c0cb..268a041 100644
--- a/extensions/tensorflow/TFConvertImageToTensor.h
+++ b/extensions/tensorflow/TFConvertImageToTensor.h
@@ -115,4 +115,4 @@
} /* namespace apache */
} /* namespace org */
-#endif //NIFI_MINIFI_CPP_TFCONVERTIMAGETOTENSOR_H
+#endif // NIFI_MINIFI_CPP_TFCONVERTIMAGETOTENSOR_H
diff --git a/extensions/tensorflow/TFExtractTopLabels.h b/extensions/tensorflow/TFExtractTopLabels.h
index 65a3651..85b0244 100644
--- a/extensions/tensorflow/TFExtractTopLabels.h
+++ b/extensions/tensorflow/TFExtractTopLabels.h
@@ -89,4 +89,4 @@
} /* namespace apache */
} /* namespace org */
-#endif //NIFI_MINIFI_CPP_TFEXTRACTTOPLABELS_H
+#endif // NIFI_MINIFI_CPP_TFEXTRACTTOPLABELS_H
diff --git a/extensions/windows-event-log/ConsumeWindowsEventLog.cpp b/extensions/windows-event-log/ConsumeWindowsEventLog.cpp
index 1192fa0..f1d96db 100644
--- a/extensions/windows-event-log/ConsumeWindowsEventLog.cpp
+++ b/extensions/windows-event-log/ConsumeWindowsEventLog.cpp
@@ -602,7 +602,7 @@
}
wel::XmlString writer;
- doc.print(writer, "", pugi::format_raw); // no indentation or formatting
+ doc.print(writer, "", pugi::format_raw); // no indentation or formatting
xml = writer.xml_;
eventRender.text_ = std::move(xml);
diff --git a/extensions/windows-event-log/TailEventLog.cpp b/extensions/windows-event-log/TailEventLog.cpp
index e52428d..399d38a 100644
--- a/extensions/windows-event-log/TailEventLog.cpp
+++ b/extensions/windows-event-log/TailEventLog.cpp
@@ -113,8 +113,6 @@
flowFile->addAttribute("event_time", getTimeStamp(event_record->TimeGenerated));
flowFile->addAttribute("event_type", typeToString(event_record->EventType));
- //flowFile->addAttribute("", event_message);
-
io::DataStream stream((const uint8_t*)(event_record + event_record->DataOffset), event_record->DataLength);
// need an import from the data stream.
diff --git a/extensions/windows-event-log/TailEventLog.h b/extensions/windows-event-log/TailEventLog.h
index d73b2db..53b98db 100644
--- a/extensions/windows-event-log/TailEventLog.h
+++ b/extensions/windows-event-log/TailEventLog.h
@@ -31,7 +31,7 @@
namespace minifi {
namespace processors {
-#define MAX_RECORD_BUFFER_SIZE 0x10000 // 64k
+#define MAX_RECORD_BUFFER_SIZE 0x10000 // 64k
const LPWSTR pEventTypeNames[] = { L"Error", L"Warning", L"Informational", L"Audit Success", L"Audit Failure" };
char log_name[255] = "Application";
diff --git a/extensions/windows-event-log/wel/MetadataWalker.cpp b/extensions/windows-event-log/wel/MetadataWalker.cpp
index 495069a..2c8e682 100644
--- a/extensions/windows-event-log/wel/MetadataWalker.cpp
+++ b/extensions/windows-event-log/wel/MetadataWalker.cpp
@@ -164,7 +164,7 @@
if (result) {
doc.traverse(walker);
wel::XmlString writer;
- doc.print(writer, "", pugi::format_raw); // no indentation or formatting
+ doc.print(writer, "", pugi::format_raw); // no indentation or formatting
return writer.xml_;
}
else {
diff --git a/extensions/windows-event-log/wel/WindowsEventLog.h b/extensions/windows-event-log/wel/WindowsEventLog.h
index aa9e880..3b57de1 100644
--- a/extensions/windows-event-log/wel/WindowsEventLog.h
+++ b/extensions/windows-event-log/wel/WindowsEventLog.h
@@ -190,7 +190,7 @@
for (const auto &option : header_names_) {
max = (std::max(max, option.second.size()));
}
- ++max; // increment by one to get space.
+ ++max; // increment by one to get space.
for (const auto &option : header_names_) {
auto name = option.second;
if (!name.empty()) {
diff --git a/libminifi/test/BufferReader.h b/libminifi/test/BufferReader.h
index f40a180..3336279 100644
--- a/libminifi/test/BufferReader.h
+++ b/libminifi/test/BufferReader.h
@@ -50,4 +50,4 @@
std::vector<uint8_t>& buffer_;
};
-#endif //NIFI_MINIFI_CPP_BUFFERREADER_H
+#endif // NIFI_MINIFI_CPP_BUFFERREADER_H
diff --git a/libminifi/test/KamikazeProcessor.h b/libminifi/test/KamikazeProcessor.h
index a8a35d1..0c5b752 100644
--- a/libminifi/test/KamikazeProcessor.h
+++ b/libminifi/test/KamikazeProcessor.h
@@ -73,4 +73,4 @@
} /* namespace apache */
} /* namespace org */
-#endif //NIFI_MINIFI_CPP_KAMIKAZEPROCESSOR_H
+#endif // NIFI_MINIFI_CPP_KAMIKAZEPROCESSOR_H
diff --git a/libminifi/test/RandomServerSocket.h b/libminifi/test/RandomServerSocket.h
index 1cf7a57..2915e74 100644
--- a/libminifi/test/RandomServerSocket.h
+++ b/libminifi/test/RandomServerSocket.h
@@ -38,4 +38,4 @@
} /* namespace apache */
} /* namespace org */
-#endif //NIFI_MINIFI_CPP_RANDOMSERVERSOCKET_H
+#endif // NIFI_MINIFI_CPP_RANDOMSERVERSOCKET_H
diff --git a/libminifi/test/flow-tests/CustomProcessors.h b/libminifi/test/flow-tests/CustomProcessors.h
index 6b8605b..223fb8a 100644
--- a/libminifi/test/flow-tests/CustomProcessors.h
+++ b/libminifi/test/flow-tests/CustomProcessors.h
@@ -112,4 +112,4 @@
} /* namespace apache */
} /* namespace org */
-#endif //NIFI_MINIFI_CPP_CUSTOMPROCESSORS_H
+#endif // NIFI_MINIFI_CPP_CUSTOMPROCESSORS_H
diff --git a/libminifi/test/flow-tests/TestControllerWithFlow.h b/libminifi/test/flow-tests/TestControllerWithFlow.h
index 25cd151..efcf166 100644
--- a/libminifi/test/flow-tests/TestControllerWithFlow.h
+++ b/libminifi/test/flow-tests/TestControllerWithFlow.h
@@ -72,4 +72,4 @@
std::shared_ptr<core::ProcessGroup> root_;
};
-#endif //NIFI_MINIFI_CPP_TESTCONTROLLERWITHFLOW_H
+#endif // NIFI_MINIFI_CPP_TESTCONTROLLERWITHFLOW_H
diff --git a/libminifi/test/unit/MockClasses.h b/libminifi/test/unit/MockClasses.h
index 353bdce..695137a 100644
--- a/libminifi/test/unit/MockClasses.h
+++ b/libminifi/test/unit/MockClasses.h
@@ -114,7 +114,7 @@
assert(false == context->isControllerServiceEnabled(linked_service));
}
- //verify we have access to the controller service
+ // verify we have access to the controller service
// and verify that we can execute it.
}
diff --git a/main/MainHelper.cpp b/main/MainHelper.cpp
index 2b4e30d..7f0a8a4 100644
--- a/main/MainHelper.cpp
+++ b/main/MainHelper.cpp
@@ -24,7 +24,7 @@
#ifdef WIN32
FILE* __cdecl _imp____iob_func() {
- struct _iobuf_VS2012 { // ...\Microsoft Visual Studio 11.0\VC\include\stdio.h #56
+ struct _iobuf_VS2012 { // ...\Microsoft Visual Studio 11.0\VC\include\stdio.h #56
char *_ptr;
int _cnt;
char *_base;
@@ -50,7 +50,7 @@
}
FILE* __cdecl __imp___iob_func() {
- struct _iobuf_VS2012 { // ...\Microsoft Visual Studio 11.0\VC\include\stdio.h #56
+ struct _iobuf_VS2012 { // ...\Microsoft Visual Studio 11.0\VC\include\stdio.h #56
char *_ptr;
int _cnt;
char *_base;
diff --git a/main/MiNiFiWindowsService.cpp b/main/MiNiFiWindowsService.cpp
index 3cd74b2..9f4e345 100644
--- a/main/MiNiFiWindowsService.cpp
+++ b/main/MiNiFiWindowsService.cpp
@@ -27,7 +27,6 @@
#include "MainHelper.h"
#include "core/FlowConfiguration.h"
-//#define DEBUG_SERVICE
#ifdef LOG_INFO
#undef LOG_INFO
#endif
diff --git a/nanofi/examples/generate_flow.c b/nanofi/examples/generate_flow.c
index 596d65b..a63f882 100644
--- a/nanofi/examples/generate_flow.c
+++ b/nanofi/examples/generate_flow.c
@@ -57,8 +57,8 @@
free_flowfile(record);
// initializing will make the transmission slightly more efficient.
- //initialize_instance(instance);
- //transfer_file_or_directory(instance,file);
+ // initialize_instance(instance);
+ // transfer_file_or_directory(instance,file);
free_flow(new_flow);
diff --git a/nanofi/examples/hash_file.c b/nanofi/examples/hash_file.c
index be1a157..f083bf0 100644
--- a/nanofi/examples/hash_file.c
+++ b/nanofi/examples/hash_file.c
@@ -52,7 +52,7 @@
char prop_value[50];
if(get_property(ctx, "checksum_attr_name", prop_value, 50) != 0) {
- return; // Attr name not found
+ return; // Attr name not found
}
add_attribute(ffr, prop_value, (void*)md5string, strlen(md5string));
@@ -118,4 +118,4 @@
return 0;
}
-#endif //OPENSSL_SUPPORT
+#endif // OPENSSL_SUPPORT
diff --git a/nanofi/examples/transmit_flow.c b/nanofi/examples/transmit_flow.c
index 68bda55..f98c8c2 100644
--- a/nanofi/examples/transmit_flow.c
+++ b/nanofi/examples/transmit_flow.c
@@ -86,10 +86,10 @@
nifi_instance *instance = create_instance(instance_str, &port);
// initializing will make the transmission slightly more efficient.
- //initialize_instance(instance);
+ // initialize_instance(instance);
transfer_file_or_directory(instance,file);
- //Create flowfile without content (just a set of attributes)
+ // Create flowfile without content (just a set of attributes)
flow_file_record * record = create_ff_object_nc();
const char * custom_value = "transmitted value";
diff --git a/nanofi/include/api/ecu.h b/nanofi/include/api/ecu.h
index 9549491..76882ee 100644
--- a/nanofi/include/api/ecu.h
+++ b/nanofi/include/api/ecu.h
@@ -35,7 +35,7 @@
} proc_properties;
typedef struct processor_params {
- char uuid_str[37]; //key
+ char uuid_str[37]; // key
struct flow_file_list * ff_list;
uint64_t curr_offset;
struct proc_properties * properties;
diff --git a/nanofi/include/core/cstream.h b/nanofi/include/core/cstream.h
index 0a46a0e..dacc700 100644
--- a/nanofi/include/core/cstream.h
+++ b/nanofi/include/core/cstream.h
@@ -70,4 +70,4 @@
}
#endif
-#endif //NIFI_MINIFI_CPP_CSTREAM_H
+#endif // NIFI_MINIFI_CPP_CSTREAM_H
diff --git a/nanofi/include/core/cuuid.h b/nanofi/include/core/cuuid.h
index dd90b0d..47e306c 100644
--- a/nanofi/include/core/cuuid.h
+++ b/nanofi/include/core/cuuid.h
@@ -38,4 +38,4 @@
}
#endif
-#endif //NIFI_MINIFI_CPP_CUUID_H
+#endif // NIFI_MINIFI_CPP_CUUID_H
diff --git a/nanofi/include/core/cxxstructs.h b/nanofi/include/core/cxxstructs.h
index 29f7f5a..63978bf 100644
--- a/nanofi/include/core/cxxstructs.h
+++ b/nanofi/include/core/cxxstructs.h
@@ -43,4 +43,4 @@
using core::ProcessContext::ProcessContext;
};
-#endif //NIFI_MINIFI_CPP_CXXSTRUCTS_H
+#endif // NIFI_MINIFI_CPP_CXXSTRUCTS_H
diff --git a/nanofi/include/core/log.h b/nanofi/include/core/log.h
index 84db4a7..405b7c4 100644
--- a/nanofi/include/core/log.h
+++ b/nanofi/include/core/log.h
@@ -40,7 +40,7 @@
static const char *log_level_str[trace+1] = { "OFF", "CRITICAL", "ERROR", "WARN", "INFO", "DEBUG", "TRACE" };
-#if __STDC_VERSION__ >= 199901L //C99 compiler support for __func__
+#if __STDC_VERSION__ >= 199901L // C99 compiler support for __func__
#if defined(__GNUC__)
#define logc(level, format, ...) \
if (level <= global_log_level && level > off) do { \
@@ -51,15 +51,15 @@
if (level <= global_log_level && level > off) do { \
fprintf(stderr, "%s:%u: [%s] %s: " format "\n", __FILE__, __LINE__, __func__, log_level_str[level], __VA_ARGS__); \
} while (0)
-#endif //__GNUC__
-#else // no C99
+#endif // __GNUC__
+#else // no C99
#define logc(level, ...) \
if (level <= global_log_level && level > off) do { \
fprintf(stderr, "%s:%d: %s:", __FILE__, __LINE__, log_level_str[level]); \
fprintf(stderr, __VA_ARGS__); \
fprintf(stderr, "\n"); \
} while (0)
-#endif //C99 compiler support
+#endif // C99 compiler support
static void set_log_level(log_level lvl) {
if(lvl >= off && lvl <= trace) {
@@ -72,4 +72,4 @@
}
#endif
-#endif //NIFI_MINIFI_CPP_LOG_H
+#endif // NIFI_MINIFI_CPP_LOG_H
diff --git a/nanofi/include/core/string_utils.h b/nanofi/include/core/string_utils.h
index c9c85eb..6b6c4f7 100644
--- a/nanofi/include/core/string_utils.h
+++ b/nanofi/include/core/string_utils.h
@@ -91,4 +91,4 @@
}
#endif
-#endif //NIFI_MINIFI_CPP_STRING_UTILS_H
+#endif // NIFI_MINIFI_CPP_STRING_UTILS_H
diff --git a/nanofi/include/sitetosite/CPeer.h b/nanofi/include/sitetosite/CPeer.h
index d23cab3..59237a8 100644
--- a/nanofi/include/sitetosite/CPeer.h
+++ b/nanofi/include/sitetosite/CPeer.h
@@ -70,9 +70,9 @@
return;
}
size_t host_len = strlen(hostname);
- peer->_host = (char*)malloc(host_len + 1); // +1 for trailing zero
- peer->_url = (char*)malloc(host_len + 14); // +1 for trailing zero, 1 for ':', at most 5 for port, 7 for "nifi://" suffix
- memset(peer->_url, 0, host_len + 14); // make sure to have zero padding no matter the length of the port
+ peer->_host = (char*)malloc(host_len + 1); // +1 for trailing zero
+ peer->_url = (char*)malloc(host_len + 14); // +1 for trailing zero, 1 for ':', at most 5 for port, 7 for "nifi://" suffix
+ memset(peer->_url, 0, host_len + 14); // make sure to have zero padding no matter the length of the port
strncpy(peer->_host, hostname, host_len);
strncpy(peer->_url, "nifi://", 7);
strncpy(peer->_url + 7, hostname, host_len);
@@ -88,9 +88,9 @@
peer->_port = port;
if(peer->_url != NULL) {
int i;
- for(i = strlen(peer->_url) -1; i >= 0; --i) { // look for the last ':' in the string
+ for(i = strlen(peer->_url) -1; i >= 0; --i) { // look for the last ':' in the string
if(peer->_url[i] == ':'){
- memset(peer->_url + i + 1, 0, 6); // zero the port area - the new port can be shorter
+ memset(peer->_url + i + 1, 0, 6); // zero the port area - the new port can be shorter
snprintf(peer->_url + i + 1, 6, "%d", peer->_port);
break;
}
diff --git a/nanofi/include/sitetosite/CRawSocketProtocol.h b/nanofi/include/sitetosite/CRawSocketProtocol.h
index 03725e8..e4fdc3c 100644
--- a/nanofi/include/sitetosite/CRawSocketProtocol.h
+++ b/nanofi/include/sitetosite/CRawSocketProtocol.h
@@ -114,7 +114,7 @@
// portIDStr
char _port_id_str[37];
- char _description_buffer[DESCRIPTION_BUFFER_SIZE]; //should be big enough
+ char _description_buffer[DESCRIPTION_BUFFER_SIZE]; // should be big enough
// Peer Connection
struct SiteToSiteCPeer* _peer;
diff --git a/nanofi/include/sitetosite/CSiteToSite.h b/nanofi/include/sitetosite/CSiteToSite.h
index 7b9cab2..a72d6b6 100644
--- a/nanofi/include/sitetosite/CSiteToSite.h
+++ b/nanofi/include/sitetosite/CSiteToSite.h
@@ -194,7 +194,7 @@
// transaction indicators
CONTINUE_TRANSACTION = 10,
FINISH_TRANSACTION = 11,
- CONFIRM_TRANSACTION = 12,// "Explanation" of this code is the checksum
+ CONFIRM_TRANSACTION = 12, // "Explanation" of this code is the checksum
TRANSACTION_FINISHED = 13,
TRANSACTION_FINISHED_BUT_DESTINATION_FULL = 14,
CANCEL_TRANSACTION = 15,
@@ -267,7 +267,6 @@
// Whether received data is available
int _dataAvailable;
- //org::apache::nifi::minifi::io::BaseStream* _stream;
cstream * _stream;
uLong _crc;
@@ -332,7 +331,6 @@
}
static int readData(CTransaction * transaction, uint8_t *buf, int buflen) {
- //int ret = transaction->_stream->read(buf, buflen);
int ret = read_buffer(buf, buflen, transaction->_stream);
if (ret > 0) {
transaction->_crc = crc32(transaction->_crc, buf, ret);
diff --git a/nanofi/src/api/nanofi.cpp b/nanofi/src/api/nanofi.cpp
index 03a6d26..2fc2e7e 100644
--- a/nanofi/src/api/nanofi.cpp
+++ b/nanofi/src/api/nanofi.cpp
@@ -41,7 +41,7 @@
static int initialized;
};
-//Just an internal utility func., not to be published via API!
+// Just an internal utility func., not to be published via API!
file_buffer file_to_buffer(const char *path) {
file_buffer fb;
fb.buffer = nullptr;
@@ -59,7 +59,7 @@
filelen = ftell(fileptr);
rewind(fileptr);
- buffer = (uint8_t *)malloc((filelen+1)*sizeof(uint8_t)); // Enough memory for file + \0
+ buffer = (uint8_t *)malloc((filelen+1)*sizeof(uint8_t)); // Enough memory for file + \0
const size_t read_result = fread(buffer, filelen, 1, fileptr);
fclose(fileptr);
@@ -487,7 +487,7 @@
auto content_repo = minifi_instance_ref->getContentRepository();
std::shared_ptr<minifi::ResourceClaim> claim = nullptr;
- std::shared_ptr<minifi::io::DataStream> stream = nullptr; //Used when content is not in content repo
+ std::shared_ptr<minifi::io::DataStream> stream = nullptr; // Used when content is not in content repo
if(ff->contentLocation) {
auto ff_content_repo_ptr = (static_cast<std::shared_ptr<minifi::core::ContentRepository>*>(ff->crp));
@@ -503,7 +503,7 @@
free(fb.buffer);
}
} else {
- //The flowfile has no content - create an empty stream to create empty content
+ // The flowfile has no content - create an empty stream to create empty content
stream = std::make_shared<minifi::io::DataStream>();
}
@@ -544,7 +544,7 @@
return nullptr;
}
auto lambda = [logic](core::ProcessSession *ps, core::ProcessContext *cx) {
- logic(static_cast<processor_session*>(ps), static_cast<processor_context*>(cx)); //Meh, sorry for this
+ logic(static_cast<processor_session*>(ps), static_cast<processor_context*>(cx)); // Meh, sorry for this
};
auto proc = flow->addCallback(nullptr, lambda);
return static_cast<processor*>(proc.get());
diff --git a/nanofi/src/core/cstream.c b/nanofi/src/core/cstream.c
index d6d244f..8bc37c7 100644
--- a/nanofi/src/core/cstream.c
+++ b/nanofi/src/core/cstream.c
@@ -22,9 +22,9 @@
#include <ws2tcpip.h>
#else
#include <sys/socket.h> // socket
-#include <arpa/inet.h> // inet_addr
-#include <netdb.h> // hostent
-#include <unistd.h> // close
+#include <arpa/inet.h> // inet_addr
+#include <netdb.h> // hostent
+#include <unistd.h> // close
#endif
#include <errno.h>
@@ -149,7 +149,6 @@
}
int readUTF(char * buf, uint32_t buflen, cstream * stream) {
- //return stream->impl->readData((uint8_t*)buf, buflen);
return read_buffer((uint8_t*)buf, (int) buflen, stream);
}
diff --git a/nanofi/src/sitetosite/CPeer.c b/nanofi/src/sitetosite/CPeer.c
index 70ecede..f2ec76a 100644
--- a/nanofi/src/sitetosite/CPeer.c
+++ b/nanofi/src/sitetosite/CPeer.c
@@ -27,7 +27,7 @@
return -1;
}
- //In case there was no socket injected, let's create it
+ // In case there was no socket injected, let's create it
if(peer->_stream == NULL) {
peer->_stream = create_socket(peer->_host, peer->_port);
if(peer->_stream == NULL) {
diff --git a/nanofi/src/sitetosite/CRawSocketProtocol.c b/nanofi/src/sitetosite/CRawSocketProtocol.c
index 4874cc7..50e1f35 100644
--- a/nanofi/src/sitetosite/CRawSocketProtocol.c
+++ b/nanofi/src/sitetosite/CRawSocketProtocol.c
@@ -72,10 +72,8 @@
int handShake(struct CRawSiteToSiteClient * client) {
if (client->_peer_state != ESTABLISHED) {
- //client->logger_->log_error("Site2Site peer state is not established while handshake");
return -1;
}
- //client->logger_->log_debug("Site2Site Protocol Perform hand shake with destination port %s", client->_port_id_str);
CIDGenerator gen;
gen.implementation_ = CUUID_DEFAULT_IMPL;
@@ -152,8 +150,6 @@
int ret_val = 0;
if (client->_currentVersion >= 3) {
-
- //ret = client->_peer->writeUTF(client->_peer->getURL());
const char * urlstr = getURL(client->_peer);
ret = writeUTF(urlstr, strlen(urlstr), False, client->_peer->_stream);
if (ret <= 0) {
diff --git a/nanofi/tests/CSite2SiteTests.cpp b/nanofi/tests/CSite2SiteTests.cpp
index 3b1ff60..60a9326 100644
--- a/nanofi/tests/CSite2SiteTests.cpp
+++ b/nanofi/tests/CSite2SiteTests.cpp
@@ -42,7 +42,7 @@
const char * ATTR_NAME = "some_key";
const char * ATTR_VALUE = "some value";
const char * PAYLOAD = "Test MiNiFi payload";
-const char * PAYLOAD_CRC = "2006463717"; // Depends on both payload and attributes, do NOT change manually!
+const char * PAYLOAD_CRC = "2006463717"; // Depends on both payload and attributes, do NOT change manually!
std::string CODEC_NAME = "StandardFlowFileCodec";
struct S2SReceivedData {
@@ -63,7 +63,7 @@
void wait_until(std::atomic<bool>& b) {
while(!b) {
- std::this_thread::sleep_for(std::chrono::milliseconds(0)); //Just yield
+ std::this_thread::sleep_for(std::chrono::milliseconds(0)); // Just yield
}
}
@@ -95,10 +95,10 @@
}
void accept_transfer(minifi::io::BaseStream* stream, const std::string& crcstr, TransferState& transfer_state, S2SReceivedData& s2s_data) {
- //In long term it would be nice to calculate the crc of the received data here
- send_response_code(stream, 12); // confirmed
+ // In long term it would be nice to calculate the crc of the received data here
+ send_response_code(stream, 12); // confirmed
stream->writeUTF(crcstr);
- send_response_code(stream, 13); // transaction finished
+ send_response_code(stream, 13); // transaction finished
wait_until(transfer_state.transer_completed);
@@ -125,7 +125,7 @@
}
void sunny_path_bootstrap(minifi::io::BaseStream* stream, TransferState& transfer_state, S2SReceivedData& s2s_data) {
- //Verify the magic string
+ // Verify the magic string
char c_array[4];
stream->readData((uint8_t*)c_array, 4);
s2s_data.magic_string = std::string(c_array, 4);
@@ -134,7 +134,7 @@
send_response_code(stream, 0x1);
stream->write(&success, 1);
- //just consume handshake data
+ // just consume handshake data
bool found_codec = false;
int read_len = 0;
while(!found_codec) {
@@ -148,7 +148,7 @@
auto it = std::search(incoming_data.begin(), incoming_data.end(), CODEC_NAME.begin(), CODEC_NAME.end());
if(it != incoming_data.end()){
size_t idx = std::distance(incoming_data.begin(), it);
- //Actual version follows the string as an uint32_t // that should be the end of the buffer
+ // Actual version follows the string as an uint32_t // that should be the end of the buffer
found_codec = idx + CODEC_NAME.length() + sizeof(uint32_t) == read_len;
}
}
diff --git a/nanofi/tests/CTailFileChunkTests.cpp b/nanofi/tests/CTailFileChunkTests.cpp
index da67385..9ba02e7 100644
--- a/nanofi/tests/CTailFileChunkTests.cpp
+++ b/nanofi/tests/CTailFileChunkTests.cpp
@@ -40,7 +40,7 @@
const char * file = "./e.txt";
const char * chunksize = "4096";
- //Write 8192 bytes to the file
+ // Write 8192 bytes to the file
FileManager fm(file);
fm.WriteNChars(4096, 'a');
fm.WriteNChars(4096, 'b');
@@ -56,13 +56,13 @@
get_proc_uuid_from_processor(proc, uuid_str);
struct processor_params * pp = get_proc_params(uuid_str);
- //Test that two flow file records were created
+ // Test that two flow file records were created
REQUIRE(pp != NULL);
REQUIRE(pp->ff_list != NULL);
REQUIRE(pp->ff_list->ff_record != NULL);
REQUIRE(flow_files_size(pp->ff_list) == 2);
- //Test that the current offset in the file is 8192 bytes
+ // Test that the current offset in the file is 8192 bytes
REQUIRE(pp->curr_offset == 8192);
}
@@ -72,7 +72,7 @@
const char * file = "./e.txt";
const char * chunksize = "4096";
- //Write 4505 bytes to the file
+ // Write 4505 bytes to the file
FileManager fm(file);
fm.WriteNChars(4096, 'a');
fm.WriteNChars(409, 'b');
@@ -87,13 +87,13 @@
char uuid_str[37];
get_proc_uuid_from_processor(proc, uuid_str);
struct processor_params * pp = get_proc_params(uuid_str);
- //Test that one flow file record was created
+ // Test that one flow file record was created
REQUIRE(pp != NULL);
REQUIRE(pp->ff_list != NULL);
REQUIRE(pp->ff_list->ff_record != NULL);
REQUIRE(flow_files_size(pp->ff_list) == 1);
- //Test that the current offset in the file is 4096 bytes
+ // Test that the current offset in the file is 4096 bytes
REQUIRE(pp->curr_offset == 4096);
REQUIRE(pp->ff_list->ff_record->size == 4096);
@@ -108,7 +108,7 @@
const char * file = "./e.txt";
const char * chunksize = "512";
- //Write 4608 bytes to the file
+ // Write 4608 bytes to the file
FileManager fm(file);
fm.WriteNChars(4608, 'a');
fm.CloseStream();
@@ -123,13 +123,13 @@
get_proc_uuid_from_processor(proc, uuid_str);
struct processor_params * pp = get_proc_params(uuid_str);
- //Test that one flow file record was created
+ // Test that one flow file record was created
REQUIRE(pp != NULL);
REQUIRE(pp->ff_list != NULL);
REQUIRE(pp->ff_list->ff_record != NULL);
REQUIRE(flow_files_size(pp->ff_list) == 9);
- //Test that the current offset in the file is 4608 bytes
+ // Test that the current offset in the file is 4608 bytes
REQUIRE(pp->curr_offset == 4608);
}
#endif
diff --git a/nanofi/tests/CTailFileDelimitedTests.cpp b/nanofi/tests/CTailFileDelimitedTests.cpp
index c43d59e..6b34233 100644
--- a/nanofi/tests/CTailFileDelimitedTests.cpp
+++ b/nanofi/tests/CTailFileDelimitedTests.cpp
@@ -32,12 +32,12 @@
const char * file = "./e.txt";
const char * delimiter = ";";
- //Create empty file
+ // Create empty file
FileManager fm(file);
auto pp = invoke_processor(mgr, file);
- //Test that no flowfiles were created
+ // Test that no flowfiles were created
REQUIRE(pp != NULL);
REQUIRE(pp->ff_list == NULL);
}
@@ -54,13 +54,13 @@
auto pp = invoke_processor(mgr, file);
- //No flow files will be created
+ // No flow files will be created
REQUIRE(pp != NULL);
REQUIRE(pp->ff_list != NULL);
REQUIRE(flow_files_size(pp->ff_list) == 1);
REQUIRE(pp->ff_list->complete == 0);
- //Test that the current offset in the file is 34
+ // Test that the current offset in the file is 34
REQUIRE(pp->curr_offset == 34);
}
@@ -70,7 +70,7 @@
const char * file = "./e.txt";
const char * delimiter = ";";
- //Write 8192 bytes to the file
+ // Write 8192 bytes to the file
FileManager fm(file);
fm.WriteNChars(34, 'a');
fm.WriteNChars(1, ';');
@@ -80,16 +80,16 @@
auto pp = invoke_processor(mgr, file);
- //Test that two flow file records were created
+ // Test that two flow file records were created
REQUIRE(pp != NULL);
REQUIRE(pp->ff_list != NULL);
REQUIRE(pp->ff_list->ff_record != NULL);
REQUIRE(flow_files_size(pp->ff_list) == 2);
- //Test that the current offset in the file is 42 bytes
+ // Test that the current offset in the file is 42 bytes
REQUIRE(pp->curr_offset == 42);
- //Test the flow file sizes
+ // Test the flow file sizes
const char * flowfile1_path = pp->ff_list->ff_record->contentLocation;
const char * flowfile2_path = pp->ff_list->next->ff_record->contentLocation;
@@ -110,7 +110,7 @@
const char * file = "./e.txt";
const char * delimiter = ";";
- //Write 8192 bytes to the file
+ // Write 8192 bytes to the file
FileManager fm(file);
fm.WriteNChars(34, 'a');
fm.WriteNChars(1, ';');
@@ -119,13 +119,13 @@
auto pp = invoke_processor(mgr, file);
- //Test that two flow file records were created
+ // Test that two flow file records were created
REQUIRE(pp != NULL);
REQUIRE(pp->ff_list != NULL);
REQUIRE(pp->ff_list->ff_record != NULL);
REQUIRE(flow_files_size(pp->ff_list) == 2);
- //Test that the current offset in the file is 35 bytes
+ // Test that the current offset in the file is 35 bytes
REQUIRE(pp->curr_offset == 67);
REQUIRE(pp->ff_list->complete == 1);
REQUIRE(pp->ff_list->next->complete == 0);
@@ -133,7 +133,7 @@
stat(pp->ff_list->ff_record->contentLocation, &fstat);
REQUIRE(fstat.st_size == 34);
- //Append a delimiter at the end of the file
+ // Append a delimiter at the end of the file
fm.OpenStream();
fm.WriteNChars(1, ';');
fm.CloseStream();
@@ -153,7 +153,7 @@
const char * file = "./e.txt";
const char * delimiter = ";";
- //Write 4096 bytes to the file
+ // Write 4096 bytes to the file
FileManager fm(file);
fm.WriteNChars(4096, 'a');
fm.CloseStream();
@@ -164,10 +164,10 @@
REQUIRE(pp->ff_list != NULL);
REQUIRE(flow_files_size(pp->ff_list) == 1);
REQUIRE(pp->ff_list->complete == 0);
- //Test that the current offset in the file is 4096 bytes
+ // Test that the current offset in the file is 4096 bytes
REQUIRE(pp->curr_offset == 4096);
- //Write another 2048 characters
+ // Write another 2048 characters
fm.OpenStream();
fm.WriteNChars(2048, 'b');
fm.CloseStream();
@@ -178,10 +178,10 @@
REQUIRE(flow_files_size(pp->ff_list) == 1);
REQUIRE(pp->ff_list->complete == 0);
- //Test that the current offset in the file is (4096 + 2048)
+ // Test that the current offset in the file is (4096 + 2048)
REQUIRE(pp->curr_offset == 6144);
- //Write another 2048 characters
+ // Write another 2048 characters
fm.OpenStream();
fm.WriteNChars(2048, 'c');
fm.CloseStream();
@@ -191,10 +191,10 @@
REQUIRE(pp->ff_list != NULL);
REQUIRE(flow_files_size(pp->ff_list) == 1);
- //Test that the current offset in the file is 8192 bytes only
+ // Test that the current offset in the file is 8192 bytes only
REQUIRE(pp->curr_offset == 8192);
- //Write a delimiter at the end and expect a flow file size of 8192 bytes
+ // Write a delimiter at the end and expect a flow file size of 8192 bytes
fm.OpenStream();
fm.WriteNChars(1, ';');
fm.CloseStream();
@@ -217,7 +217,7 @@
const char * file = "./e.txt";
const char * delimiter = ";";
- //Write 8192 bytes to the file
+ // Write 8192 bytes to the file
FileManager fm(file);
fm.WriteNChars(5, ';');
fm.WriteNChars(34, 'a');
@@ -227,13 +227,13 @@
auto pp = invoke_processor(mgr, file);
- //Test that two flow file records were created
+ // Test that two flow file records were created
REQUIRE(pp != NULL);
REQUIRE(pp->ff_list != NULL);
REQUIRE(pp->ff_list->ff_record != NULL);
REQUIRE(flow_files_size(pp->ff_list) == 2);
- //Test that the current offset in the file is 35 bytes
+ // Test that the current offset in the file is 35 bytes
REQUIRE(pp->curr_offset == 75);
REQUIRE(pp->ff_list->complete == 1);
REQUIRE(pp->ff_list->next->complete == 0);
@@ -241,7 +241,7 @@
stat(pp->ff_list->ff_record->contentLocation, &fstat);
REQUIRE(fstat.st_size == 34);
- //Append a delimiter at the end of the file
+ // Append a delimiter at the end of the file
fm.OpenStream();
fm.WriteNChars(1, ';');
fm.CloseStream();