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

batchrepr: new package #3232

Merged
merged 1 commit into from
Jan 19, 2024
Merged

batchrepr: new package #3232

merged 1 commit into from
Jan 19, 2024

Conversation

jbowens
Copy link
Collaborator

@jbowens jbowens commented Jan 18, 2024

Move some of the logic related to the batch representation to a new batchrepr package. For now, this is primarily the BatchReader type and a few very small facilities around the Header. Future work may move additional logic related to writing new batch mutations and sorted iteration over a batch's contents, assuming there's no impact on performance.

This move is motivated by #3230. The planned wal package will need to inspect batch sequence numbers for deduplication when reconstructing the logical contents of a virtual WAL. Moving the logic outside the pebble package avoids duplicating the logic.

@cockroach-teamcity
Copy link
Member

This change is Reviewable

@jbowens jbowens requested review from a team, aadityasondhi and RaduBerinde January 18, 2024 17:02
@jbowens jbowens force-pushed the batchrepr branch 2 times, most recently from e24ed3e to 4f65ad6 Compare January 18, 2024 20:42
@jbowens jbowens requested a review from sumeerbhola January 19, 2024 17:11
Copy link
Collaborator

@sumeerbhola sumeerbhola left a comment

Choose a reason for hiding this comment

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

nice test improvements!

Reviewed 11 of 11 files at r1, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @aadityasondhi, @jbowens, and @RaduBerinde)


batchrepr/reader.go line 25 at r1 (raw file):

	// HeaderLen is the length of the batch header in bytes.
	HeaderLen = 12
	// countOffset is the index into the batch represenation at which the

nit: representation

Move some of the logic related to the batch representation to a new batchrepr
package. For now, this is primarily the BatchReader type and a few very small
facilities around the Header. Future work may move additional logic related to
writing new batch mutations and sorted iteration over a batch's contents,
assuming there's no impact on performance.

This move is motivated by cockroachdb#3230. The planned wal package will need to inspect
batch sequence numbers for deduplication when reconstructing the logical
contents of a virtual WAL. Moving the logic outside the pebble package avoids
duplication.
Copy link
Collaborator Author

@jbowens jbowens left a comment

Choose a reason for hiding this comment

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

TFTR!

CI test failure is #3234

Reviewable status: 9 of 11 files reviewed, 1 unresolved discussion (waiting on @aadityasondhi, @RaduBerinde, and @sumeerbhola)

@jbowens jbowens merged commit 5b09251 into cockroachdb:master Jan 19, 2024
10 of 11 checks passed
@jbowens jbowens deleted the batchrepr branch January 19, 2024 21:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants