| 108 | } |
| 109 | |
| 110 | void PutS3Object::fillUserMetadata(const std::shared_ptr<core::ProcessContext> &context) { |
| 111 | const auto &dynamic_prop_keys = context->getDynamicPropertyKeys(); |
| 112 | bool first_property = true; |
| 113 | for (const auto &prop_key : dynamic_prop_keys) { |
| 114 | std::string prop_value = ""; |
| 115 | if (context->getDynamicProperty(prop_key, prop_value) && !prop_value.empty()) { |
| 116 | logger_->log_debug("PutS3Object: DynamicProperty: [%s] -> [%s]", prop_key, prop_value); |
| 117 | user_metadata_map_.emplace(prop_key, prop_value); |
| 118 | if (first_property) { |
| 119 | user_metadata_ = prop_key + "=" + prop_value; |
| 120 | first_property = false; |
| 121 | } else { |
| 122 | user_metadata_ += "," + prop_key + "=" + prop_value; |
| 123 | } |
| 124 | } |
| 125 | } |
| 126 | logger_->log_debug("PutS3Object: User metadata [%s]", user_metadata_); |
| 127 | } |
| 128 | |
| 129 | void PutS3Object::onSchedule(const std::shared_ptr<core::ProcessContext> &context, const std::shared_ptr<core::ProcessSessionFactory> &sessionFactory) { |
| 130 | S3Processor::onSchedule(context, sessionFactory); |
nothing calls this directly
no test coverage detected