@@ -66,15 +66,37 @@ struct ObjectMetadata
6666
6767struct RelativePathWithMetadata
6868{
69+ class CommandInTaskResponse
70+ {
71+ public:
72+ CommandInTaskResponse () {}
73+ CommandInTaskResponse (const std::string & task);
74+
75+ bool is_parsed () const { return successfully_parsed; }
76+ void set_retry_after_us (Poco::Timestamp::TimeDiff time_us) { retry_after_us = time_us; }
77+
78+ std::string to_string () const ;
79+
80+ std::optional<Poco::Timestamp::TimeDiff> get_retry_after_us () const { return retry_after_us; }
81+
82+ private:
83+ bool successfully_parsed = false ;
84+ std::optional<Poco::Timestamp::TimeDiff> retry_after_us;
85+ };
86+
6987 String relative_path;
7088 std::optional<ObjectMetadata> metadata;
89+ CommandInTaskResponse command;
7190
7291 RelativePathWithMetadata () = default ;
7392
74- explicit RelativePathWithMetadata (String relative_path_, std::optional<ObjectMetadata> metadata_ = std::nullopt )
75- : relative_path(std::move(relative_path_))
76- , metadata(std::move(metadata_))
77- {}
93+ explicit RelativePathWithMetadata (const String & task_string, std::optional<ObjectMetadata> metadata_ = std::nullopt )
94+ : metadata(std::move(metadata_))
95+ , command(task_string)
96+ {
97+ if (!command.is_parsed ())
98+ relative_path = task_string;
99+ }
78100
79101 virtual ~RelativePathWithMetadata () = default ;
80102
@@ -85,6 +107,8 @@ struct RelativePathWithMetadata
85107 virtual size_t fileSizeInArchive () const { throw Exception (ErrorCodes::LOGICAL_ERROR, " Not an archive" ); }
86108
87109 void loadMetadata (ObjectStoragePtr object_storage);
110+
111+ const CommandInTaskResponse & getCommand () const { return command; }
88112};
89113
90114struct ObjectKeyWithMetadata
0 commit comments