martinzink commented on code in PR #1926:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1926#discussion_r2001009781
##########
extensions/gcp/processors/FetchGCSObject.cpp:
##########
@@ -124,18 +124,19 @@ void FetchGCSObject::onTrigger(core::ProcessContext&
context, core::ProcessSessi
FetchFromGCSCallback callback(client, *bucket, *object_name);
callback.setEncryptionKey(encryption_key_);
- if (auto gen_str = context.getProperty(ObjectGeneration, flow_file.get());
gen_str && !gen_str->empty()) {
- try {
- int64_t gen = 0;
- utils::internal::ValueParser(*gen_str).parse(gen).parseEnd();
- callback.setGeneration(gcs::Generation(gen));
- } catch (const utils::internal::ValueException&) {
- logger_->log_error("Invalid generation: {}", *gen_str);
+ gcs::Generation generation;
+ if (const auto object_generation_str =
context.getProperty(ObjectGeneration, flow_file.get()); object_generation_str
&& !object_generation_str->empty()) {
+ if (const auto geni64 =
parsing::parseIntegral<int64_t>(*object_generation_str)) {
+ generation = gcs::Generation{*geni64};
+ } else {
+ logger_->log_error("Invalid generation: {}", *object_generation_str);
session.transfer(flow_file, Failure);
return;
}
}
+ callback.setGeneration(generation);
Review Comment:
It was maybe intentional if we were to support the rescheduling of
processors with different properties this might come in handy, but reverted
nontheless (we are too far from that goal anyway)
https://github.com/apache/nifi-minifi-cpp/commit/d024e061036614342d660dfe804ce98ff3f2857f
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]