@@ -82,9 +82,7 @@ class FetchFromGCSCallback {
8282
8383MinifiStatus 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}
0 commit comments