-
Notifications
You must be signed in to change notification settings - Fork 564
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16436 from vbotbuildovich/backport-pr-16301-v23.3…
….x-934 [v23.3.x] Introduce `transform::logging::manager`
- Loading branch information
Showing
15 changed files
with
965 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
/* | ||
* Copyright 2024 Redpanda Data, Inc. | ||
* | ||
* Use of this software is governed by the Business Source License | ||
* included in the file licenses/BSL.md | ||
* | ||
* As of the Change Date specified in that file, in accordance with | ||
* the Business Source License, use of this software will be governed | ||
* by the Apache License, Version 2.0 | ||
*/ | ||
|
||
#include "cluster/errc.h" | ||
#include "model/record.h" | ||
#include "ssx/semaphore.h" | ||
#include "transform/logging/event.h" | ||
|
||
#pragma once | ||
|
||
namespace transform::logging { | ||
|
||
namespace io { | ||
struct json_batch { | ||
json_batch( | ||
model::transform_name n, | ||
ss::chunked_fifo<iobuf> e, | ||
ssx::semaphore_units units) | ||
: name(std::move(n)) | ||
, events(std::move(e)) | ||
, _units(std::move(units)) {} | ||
|
||
model::transform_name name; | ||
ss::chunked_fifo<iobuf> events; | ||
|
||
private: | ||
ssx::semaphore_units _units; | ||
}; | ||
using json_batches = ss::chunked_fifo<json_batch>; | ||
|
||
} // namespace io | ||
|
||
/** | ||
* Abstract interface providing cluster and transform system access to a single | ||
* instance the log manager. | ||
* | ||
* Responsibilities may include: | ||
* - Creating the transform_logs topic | ||
* - Batching and publishing collections of log data to the logs topic | ||
* - Computing the output partition for a given transform's outgoing logs. | ||
*/ | ||
class client { | ||
public: | ||
client() = default; | ||
client(const client&) = delete; | ||
client& operator=(const client&) = delete; | ||
client(client&&) = delete; | ||
client& operator=(client&&) = delete; | ||
virtual ~client() = default; | ||
|
||
/* | ||
* Collect io::json_batches into model::record_batch(es) and publish | ||
* | ||
* Implementations should aim to batch outgoing records maximally and | ||
* respect cluster-wide batch size limits. | ||
*/ | ||
virtual ss::future<> write(model::partition_id, io::json_batches) = 0; | ||
|
||
virtual model::partition_id | ||
compute_output_partition(model::transform_name_view name) | ||
= 0; | ||
}; | ||
} // namespace transform::logging |
Oops, something went wrong.