Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix topic templates #524

Merged
merged 1 commit into from
Aug 28, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 23 additions & 23 deletions src/containers/Tenant/utils/queryTemplates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,42 +69,42 @@ export const createTopicTemplate = (path: string) => {
return `-- docs: https://ydb.tech/en/docs/yql/reference/syntax/create_topic
CREATE TOPIC \`${path}/my_topic\` (
CONSUMER consumer1,
CONSUMER consumer2 WITH (read_from = Datetime('2022-12-01T12:13:22Z')) -- Sets up the message write time starting from which the consumer will receive data.
CONSUMER consumer2 WITH (read_from = Datetime('1970-01-01T00:00:00Z')) -- Sets up the message write time starting from which the consumer will receive data.
-- Value type: Datetime OR Timestamp OR integer (unix-timestamp in the numeric format).
-- Default value: now
) WITH (
min_active_partitions = 5, -- Minimum number of topic partitions.
partition_count_limit = 10, -- Maximum number of active partitions in the topic. 0 is interpreted as unlimited.
retention_period = Interval('PT12H'), -- Data retention period in the topic. Value type: Interval, default value: 18h.
retention_storage_mb = 1, -- Limit on the maximum disk space occupied by the topic data.
min_active_partitions = 1, -- Minimum number of topic partitions.
partition_count_limit = 0, -- Maximum number of active partitions in the topic. 0 is interpreted as unlimited.
retention_period = Interval('PT18H'), -- Data retention period in the topic. Value type: Interval.
retention_storage_mb = 0, -- Limit on the maximum disk space occupied by the topic data.
-- When this value is exceeded, the older data is cleared, like under a retention policy.
-- 0 is interpreted as unlimited.
partition_write_speed_bytes_per_second = 2097152, -- Maximum allowed write speed per partition.
partition_write_burst_bytes = 2097152 -- Write quota allocated for write bursts.
-- When set to zero, the actual write_burst value is equalled to
-- the quota value (this allows write bursts of up to one second).
partition_write_speed_bytes_per_second = 1048576, -- Maximum allowed write speed per partition.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The documentation says that the default value is 2MB/s, but in fact 1MB/s

partition_write_burst_bytes = 0 -- Write quota allocated for write bursts.
-- When set to zero, the actual write_burst value is equalled to
-- the quota value (this allows write bursts of up to one second).
);`;
};

export const alterTopicTemplate = (path: string) => {
return `-- docs: https://ydb.tech/en/docs/yql/reference/syntax/alter_topic
ALTER TOPIC \`${path}\`
ADD CONSUMER new_consumer WITH (read_from = 0), -- Sets up the message write time starting from which the consumer will receive data.
-- Value type: Datetime OR Timestamp OR integer (unix-timestamp in the numeric format).
-- Default value: now
ALTER CONSUMER consumer1 SET (read_from = Datetime('2023-12-01T12:13:22Z')),
ADD CONSUMER new_consumer WITH (read_from = Datetime('1970-01-01T00:00:00Z')), -- Sets up the message write time starting from which the consumer will receive data.
-- Value type: Datetime OR Timestamp OR integer (unix-timestamp in the numeric format).
-- Default value: now
ALTER CONSUMER consumer1 SET (read_from = Datetime('1970-01-01T00:00:00Z')),
DROP CONSUMER consumer2,
SET (
min_active_partitions = 10, -- Minimum number of topic partitions.
partition_count_limit = 15, -- Maximum number of active partitions in the topic. 0 is interpreted as unlimited.
retention_period = Interval('PT36H'), -- Data retention period in the topic. Value type: Interval, default value: 18h.
retention_storage_mb = 10, -- Limit on the maximum disk space occupied by the topic data.
-- When this value is exceeded, the older data is cleared, like under a retention policy.
-- 0 is interpreted as unlimited.
partition_write_speed_bytes_per_second = 3145728, -- Maximum allowed write speed per partition.
partition_write_burst_bytes = 1048576 -- Write quota allocated for write bursts.
-- When set to zero, the actual write_burst value is equalled to
-- the quota value (this allows write bursts of up to one second).
min_active_partitions = 1, -- Minimum number of topic partitions.
partition_count_limit = 0, -- Maximum number of active partitions in the topic. 0 is interpreted as unlimited.
retention_period = Interval('PT18H'), -- Data retention period in the topic. Value type: Interval.
retention_storage_mb = 0, -- Limit on the maximum disk space occupied by the topic data.
-- When this value is exceeded, the older data is cleared, like under a retention policy.
-- 0 is interpreted as unlimited.
partition_write_speed_bytes_per_second = 1048576, -- Maximum allowed write speed per partition.
partition_write_burst_bytes = 0 -- Write quota allocated for write bursts.
-- When set to zero, the actual write_burst value is equalled to
-- the quota value (this allows write bursts of up to one second).
);`;
};

Expand Down
Loading