Skip to content

Commit ef5127e

Browse files
committed
review changes
1 parent 3366667 commit ef5127e

4 files changed

Lines changed: 12 additions & 14 deletions

File tree

extension-framework/cpp-extension-lib/include/api/utils/Proxy.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ struct BasicAuthCredentials {
3333
};
3434

3535
struct ProxyData {
36+
ProxyType proxy_type;
3637
std::string host;
3738
uint16_t port;
3839
std::optional<BasicAuthCredentials> proxy_credentials;
39-
ProxyType proxy_type;
4040
};
4141

4242
} // namespace org::apache::nifi::minifi::api::utils

extensions/gcp/processors/DeleteGCSObject.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717

1818
#include "DeleteGCSObject.h"
1919

20-
2120
#include "../GCPAttributes.h"
2221
#include "api/core/ProcessContext.h"
2322
#include "api/core/ProcessSession.h"
@@ -56,7 +55,7 @@ MinifiStatus DeleteGCSObject::onTriggerImpl(api::core::ProcessContext& context,
5655
} else {
5756
logger_->log_error("Invalid generation: {}", *object_generation_str);
5857
session.transfer(std::move(flow_file), Failure);
59-
return MINIFI_STATUS_SUCCESS;
58+
return MINIFI_STATUS_SUCCESS;
6059
}
6160
}
6261

extensions/gcp/processors/FetchGCSObject.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,7 @@ class FetchFromGCSCallback {
8282

8383
MinifiStatus FetchGCSObject::onScheduleImpl(api::core::ProcessContext& context) {
8484
const auto status = GCSProcessor::onScheduleImpl(context);
85-
if (MINIFI_STATUS_SUCCESS != status) {
86-
return status;
87-
}
85+
if (MINIFI_STATUS_SUCCESS != status) { return status; }
8886
if (auto encryption_key = context.getProperty(EncryptionKey, nullptr)) {
8987
try {
9088
encryption_key_ = gcs::EncryptionKey::FromBase64Key(*encryption_key);
@@ -121,19 +119,18 @@ MinifiStatus FetchGCSObject::onTriggerImpl(api::core::ProcessContext& context, a
121119
FetchFromGCSCallback callback(client, *bucket, *object_name);
122120
callback.setEncryptionKey(encryption_key_);
123121

124-
if (const auto object_generation_str = api::utils::parseOptionalProperty(context, ObjectGeneration, &flow_file); object_generation_str && !object_generation_str->empty()) {
122+
if (const auto object_generation_str = api::utils::parseOptionalProperty(context, ObjectGeneration, &flow_file); object_generation_str && !object_generation_str->empty()) {
125123
if (const auto geni64 = parsing::parseIntegral<int64_t>(*object_generation_str)) {
126124
gcs::Generation generation = gcs::Generation{*geni64};
127125
callback.setGeneration(generation);
128126

129127
} else {
130128
logger_->log_error("Invalid generation: {}", *object_generation_str);
131129
session.transfer(std::move(flow_file), Failure);
132-
return MINIFI_STATUS_SUCCESS;
130+
return MINIFI_STATUS_SUCCESS;
133131
}
134132
}
135133

136-
137134
session.write(flow_file, std::ref(callback));
138135
if (!callback.getStatus().ok()) {
139136
session.setAttribute(flow_file, GCS_STATUS_MESSAGE, callback.getStatus().message());
@@ -144,12 +141,15 @@ MinifiStatus FetchGCSObject::onTriggerImpl(api::core::ProcessContext& context, a
144141
return MINIFI_STATUS_SUCCESS;
145142
}
146143

147-
if (auto generation = callback.getGeneration())
144+
if (auto generation = callback.getGeneration()) {
148145
session.setAttribute(flow_file, GCS_GENERATION, std::to_string(*generation));
149-
if (auto meta_generation = callback.getMetaGeneration())
146+
}
147+
if (auto meta_generation = callback.getMetaGeneration()) {
150148
session.setAttribute(flow_file, GCS_META_GENERATION, std::to_string(*meta_generation));
151-
if (auto storage_class = callback.getStorageClass())
149+
}
150+
if (auto storage_class = callback.getStorageClass()) {
152151
session.setAttribute(flow_file, GCS_STORAGE_CLASS, *storage_class);
152+
}
153153
session.transfer(std::move(flow_file), Success);
154154
return MINIFI_STATUS_SUCCESS;
155155
}

extensions/gcp/processors/GCSProcessor.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@ namespace gcs = ::google::cloud::storage;
2525
namespace org::apache::nifi::minifi::extensions::gcp {
2626

2727
std::shared_ptr<google::cloud::Credentials> GCSProcessor::getCredentials(const api::core::ProcessContext& context) {
28-
if (const auto gcp_credentials_controller_service = api::utils::parseOptionalControllerService<GCPCredentialsControllerService>(context,
29-
GCPCredentials)) {
28+
if (const auto gcp_credentials_controller_service = api::utils::parseOptionalControllerService<GCPCredentialsControllerService>(context, GCPCredentials)) {
3029
return gcp_credentials_controller_service->getCredentials();
3130
}
3231
return nullptr;

0 commit comments

Comments
 (0)