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

Add stage descriptions for fetch extension #14

Merged
merged 1 commit into from
Oct 24, 2024
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
103 changes: 97 additions & 6 deletions course-definition.yml
Original file line number Diff line number Diff line change
Expand Up @@ -705,7 +705,6 @@ stages:
- The correlation ID in the response header matches the correlation ID in the request header.
- The error code in the response body is `0` (No Error).
- The `throttle_time_ms` field in the response is present (any value is accepted).
- The `session_id` field in the response is `0`.
- The `responses` field in the response has 1 element, and in that element:
- The `topic_id` field matches what was sent in the request.
- The `partitions` array has 1 element, and in that element:
Expand All @@ -723,18 +722,79 @@ stages:
- slug: "cm4"
primary_extension_slug: "consuming-messages"
name: "Fetch with an empty topic"
difficulty: hard
difficulty: medium
description_md: |-
🚧 **We're still working on tests for this stage!**.
In this stage, you'll implement the Fetch response for a topic with no messages.

🚧 **We're still working on instructions for this stage**. You can find notes on how the tester works below.

In the meantime, please use
[this link](https://forum.codecrafters.io/new-topic?category=Challenges&tags=challenge%3Akafka&title=Question+about+cm4%3A+Fetch+with+an+empty+topic&body=%3Cyour+question+here%3E)
to ask questions on the forum.

### Tests

The tester will execute your program like this:

```bash
$ ./your_program.sh
```

It'll then connect to your server on port 9092 and send a `Fetch` (v16) request. The request will contain a single topic with a topic ID that exists. However, the topic has no messages assigned to it (i.e. the log file is empty).

The tester will validate that:

- The first 4 bytes of your response (the "message length") are valid.
- The correlation ID in the response header matches the correlation ID in the request header.
- The error code in the response body is `0` (No Error).
- The `throttle_time_ms` field in the response is present (any value is accepted).
- The `responses` field in the response has 1 element, and in that element:
- The `topic_id` field matches what was sent in the request.
- The `partitions` array has 1 element, and in that element:
- The `partition_index` field is `0`.
- The `error_code` field is `0` (No Error).
- The `records` array has `0` elements.

marketing_md: |-
In this stage, you'll implement the Fetch response for a topic with multiple messages.
In this stage, you'll implement the Fetch response for a topic with no messages.

- slug: "eg2"
primary_extension_slug: "consuming-messages"
name: "Fetch single message from disk"
difficulty: hard
description_md: |-
🚧 **We're still working on tests for this stage!**.
In this stage, you'll implement the Fetch response for a topic with a single message, reading it from disk.

🚧 **We're still working on instructions for this stage**. You can find notes on how the tester works below.

In the meantime, please use
[this link](https://forum.codecrafters.io/new-topic?category=Challenges&tags=challenge%3Akafka&title=Question+about+eg2%3A+Fetch+single+message+from+disk&body=%3Cyour+question+here%3E)
to ask questions on the forum.

### Tests

The tester will execute your program like this:

```bash
$ ./your_program.sh
```

It'll then connect to your server on port 9092 and send a `Fetch` (v16) request. The request will contain a single topic with a topic ID that exists. The topic has a single message assigned to it.

The tester will validate that:

- The first 4 bytes of your response (the "message length") are valid.
- The correlation ID in the response header matches the correlation ID in the request header.
- The error code in the response body is `0` (No Error).
- The `throttle_time_ms` field in the response is present (any value is accepted).
- The `responses` field in the response has 1 element, and in that element:
- The `topic_id` field matches what was sent in the request.
- The `partitions` array has 1 element, and in that element:
- The `partition_index` field is `0`.
- The `error_code` field is `0` (No Error).
- The `records` array has 1 element.
- The entire `RecordBatch` content is read from disk. (We will compare the contents of the `RecordBatch` with the contents of the log file to verify this.)

marketing_md: |-
In this stage, you'll implement the Fetch response for a topic with a single message, reading it from disk.

Expand All @@ -743,6 +803,37 @@ stages:
name: "Fetch multiple messages from disk"
difficulty: hard
description_md: |-
🚧 **We're still working on tests for this stage!**.
In this stage, you'll implement the Fetch response for a topic with multiple messages, reading them from disk.

🚧 **We're still working on instructions for this stage**. You can find notes on how the tester works below.

In the meantime, please use
[this link](https://forum.codecrafters.io/new-topic?category=Challenges&tags=challenge%3Akafka&title=Question+about+fd8%3A+Fetch+multiple+messages+from+disk&body=%3Cyour+question+here%3E)
to ask questions on the forum.

### Tests

The tester will execute your program like this:

```bash
$ ./your_program.sh
```

It'll then connect to your server on port 9092 and send a `Fetch` (v16) request. The request will contain a single topic with a topic ID that exists. The topic has multiple messages assigned to it (but written to a single partition).

The tester will validate that:

- The first 4 bytes of your response (the "message length") are valid.
- The correlation ID in the response header matches the correlation ID in the request header.
- The error code in the response body is `0` (No Error).
- The `throttle_time_ms` field in the response is present (any value is accepted).
- The `responses` field in the response has 1 element, and in that element:
- The `topic_id` field matches what was sent in the request.
- The `partitions` array has 1 element, and in that element:
- The `partition_index` field is `0`.
- The `error_code` field is `0` (No Error).
- The `records` array has the correct number of elements.
- The entire `RecordBatch` content is read from disk. (We will compare the contents of the `RecordBatch` with the contents of the log file to verify this.)

marketing_md: |-
In this stage, you'll implement the Fetch response for a topic with multiple messages, reading them from disk.
Loading