MCPcopy Create free account
hub / github.com/apache/nifi-minifi-cpp / onSchedule

Method onSchedule

extensions/aws/processors/S3Processor.cpp:199–218  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

197}
198
199void S3Processor::onSchedule(const std::shared_ptr<core::ProcessContext> &context, const std::shared_ptr<core::ProcessSessionFactory> &sessionFactory) {
200 std::string value;
201 if (!context->getProperty(Bucket.getName(), value) || value.empty()) {
202 throw Exception(PROCESS_SCHEDULE_EXCEPTION, "Bucket property missing or invalid");
203 }
204
205 if (!context->getProperty(Region.getName(), value) || value.empty() || REGIONS.count(value) == 0) {
206 throw Exception(PROCESS_SCHEDULE_EXCEPTION, "Region property missing or invalid");
207 }
208 s3_wrapper_->setRegion(value);
209 logger_->log_debug("S3Processor: Region [%s]", value);
210
211 uint64_t timeout_val;
212 if (context->getProperty(CommunicationsTimeout.getName(), value) && !value.empty() && core::Property::getTimeMSFromString(value, timeout_val)) {
213 s3_wrapper_->setTimeout(timeout_val);
214 logger_->log_debug("S3Processor: Communications Timeout [%d]", timeout_val);
215 } else {
216 throw Exception(PROCESS_SCHEDULE_EXCEPTION, "Communications Timeout missing or invalid");
217 }
218}
219
220minifi::utils::optional<CommonProperties> S3Processor::getCommonELSupportedProperties(
221 const std::shared_ptr<core::ProcessContext> &context,

Callers

nothing calls this directly

Calls 8

ExceptionClass · 0.85
getTimeMSFromStringFunction · 0.85
setRegionMethod · 0.80
log_debugMethod · 0.80
setTimeoutMethod · 0.80
getPropertyMethod · 0.45
getNameMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected