Skip to content

Commit

Permalink
Build, clang-tidy fix
Browse files Browse the repository at this point in the history
  • Loading branch information
adamdebreceni committed Oct 14, 2024
1 parent 2b1465f commit e44de21
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 39 deletions.
10 changes: 2 additions & 8 deletions extension-utils/src/serialization/PayloadSerializer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,10 @@
#include "serialization/PayloadSerializer.h"
#include "io/StreamPipe.h"

namespace org {
namespace apache {
namespace nifi {
namespace minifi {
namespace org::apache::nifi::minifi {

int64_t PayloadSerializer::serialize(const std::shared_ptr<core::FlowFile>& flowFile, const std::shared_ptr<io::OutputStream>& out) {
return reader_(flowFile, InputStreamPipe{*out});
}

} /* namespace minifi */
} /* namespace nifi */
} /* namespace apache */
} /* namespace org */
} // namespace org::apache::nifi::minifi
12 changes: 2 additions & 10 deletions extension-utils/src/utils/CallBackTimer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,7 @@
#include "utils/CallBackTimer.h"
#include <stdexcept>

namespace org {
namespace apache {
namespace nifi {
namespace minifi {
namespace utils {
namespace org::apache::nifi::minifi::utils {

CallBackTimer::CallBackTimer(std::chrono::milliseconds interval, const std::function<void(void)>& func) : execute_(false), func_(func), interval_(interval) {
}
Expand Down Expand Up @@ -85,8 +81,4 @@ bool CallBackTimer::is_running() const {
return execute_ && thd_.joinable();
}

} /* namespace utils */
} /* namespace minifi */
} /* namespace nifi */
} /* namespace apache */
} /* namespace org */
} // namespace org::apache::nifi::minifi::utils
24 changes: 8 additions & 16 deletions extensions/aws/AWSCredentialsProvider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,17 @@
#include "aws/core/auth/AWSCredentialsProviderChain.h"
#include "properties/Properties.h"

namespace org {
namespace apache {
namespace nifi {
namespace minifi {
namespace aws {
namespace org::apache::nifi::minifi::aws {

AWSCredentialsProvider::AWSCredentialsProvider(
bool use_default_credentials,
const std::string &access_key,
const std::string &secret_key,
const std::string &credentials_file)
std::string access_key,
std::string secret_key,
std::string credentials_file)
: use_default_credentials_(use_default_credentials)
, access_key_(access_key)
, secret_key_(secret_key)
, credentials_file_(credentials_file) {
, access_key_(std::move(access_key))
, secret_key_(std::move(secret_key))
, credentials_file_(std::move(credentials_file)) {
}

void AWSCredentialsProvider::setUseDefaultCredentials(bool use_default_credentials) {
Expand Down Expand Up @@ -91,8 +87,4 @@ std::optional<Aws::Auth::AWSCredentials> AWSCredentialsProvider::getAWSCredentia
return std::nullopt;
}

} // namespace aws
} // namespace minifi
} // namespace nifi
} // namespace apache
} // namespace org
} // namespace org::apache::nifi::minifi::aws
6 changes: 3 additions & 3 deletions extensions/aws/AWSCredentialsProvider.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ class AWSCredentialsProvider {
public:
explicit AWSCredentialsProvider(
bool use_default_credentials = false,
const std::string &access_key = "",
const std::string &secret_key = "",
const std::string &credentials_file = "");
std::string access_key = "",
std::string secret_key = "",
std::string credentials_file = "");
void setUseDefaultCredentials(bool use_default_credentials);
void setAccessKey(const std::string &access_key);
void setSecretKey(const std::string &secret_key);
Expand Down
2 changes: 1 addition & 1 deletion extensions/aws/processors/S3Processor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ void S3Processor::onSchedule(core::ProcessContext& context, core::ProcessSession

if (auto communications_timeout = context.getProperty<core::TimePeriodValue>(CommunicationsTimeout)) {
logger_->log_debug("S3Processor: Communications Timeout {}", communications_timeout->getMilliseconds());
client_config_->connectTimeoutMs = gsl::narrow<long>(communications_timeout->getMilliseconds().count()); // NOLINT(runtime/int)
client_config_->connectTimeoutMs = gsl::narrow<long>(communications_timeout->getMilliseconds().count()); // NOLINT(runtime/int,google-runtime-int)
} else {
throw Exception(PROCESS_SCHEDULE_EXCEPTION, "Communications Timeout missing or invalid");
}
Expand Down
2 changes: 1 addition & 1 deletion extensions/azure/storage/AzureBlobStorageClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ std::unique_ptr<io::InputStream> AzureBlobStorageClient::fetchBlob(const FetchAz
if (params.range_start || params.range_length) {
Azure::Core::Http::HttpRange range;
if (params.range_start) {
range.Offset = *params.range_start;
range.Offset = gsl::narrow<int64_t>(*params.range_start);
}

if (params.range_length) {
Expand Down
8 changes: 8 additions & 0 deletions libminifi/test/unit/SchedulingAgentTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ class CountOnTriggersProcessor : public minifi::core::ProcessorImpl {
std::atomic<size_t> number_of_triggers = 0;
};

#ifdef __GNUC__
// array-bounds warnings in GCC produce a lot of false positives: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56456
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Warray-bounds"
#endif
class SchedulingAgentTestFixture {
public:
SchedulingAgentTestFixture() {
Expand Down Expand Up @@ -87,6 +92,9 @@ class SchedulingAgentTestFixture {
std::shared_ptr<core::ProcessContext> context_ = std::make_shared<core::ProcessContextImpl>(node_, nullptr, test_repo_, test_repo_, content_repo_);
std::shared_ptr<core::ProcessSessionFactory> factory_ = std::make_shared<core::ProcessSessionFactoryImpl>(context_);
};
#ifdef __GNUC__
#pragma GCC diagnostic pop
#endif


TEST_CASE_METHOD(SchedulingAgentTestFixture, "TimerDrivenSchedulingAgent") {
Expand Down

0 comments on commit e44de21

Please sign in to comment.