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

Used pooled buffering for compression and batch serialization #292

Merged
merged 1 commit into from
Jun 22, 2020

Conversation

merlimat
Copy link
Contributor

Motivation

  • Used pooled buffers when serializing a batch of messages
  • Perform in-place compression into the batch buffer

@merlimat merlimat added this to the 0.2.0 milestone Jun 21, 2020
@merlimat merlimat self-assigned this Jun 21, 2020
@@ -859,7 +859,7 @@ func (pc *partitionConsumer) Decompress(msgMeta *pb.MessageMetadata, payload int
pc.compressionProviders[msgMeta.GetCompression()] = provider
}

uncompressed, err := provider.Decompress(payload.ReadableSlice(), int(msgMeta.GetUncompressedSize()))
uncompressed, err := provider.Decompress(nil, payload.ReadableSlice(), int(msgMeta.GetUncompressedSize()))

Choose a reason for hiding this comment

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

have a method definition that does not require nil as a parameter.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It’s an established convention in Go APIs. For example all the compression implementations are using that.

@merlimat merlimat merged commit 2d66c7b into apache:master Jun 22, 2020
@merlimat merlimat deleted the in-place-compression branch June 22, 2020 16:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants