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

Another way to drop raw bytes of the capture data #2186

Merged
merged 1 commit into from
Sep 18, 2018

Conversation

Qining
Copy link
Contributor

@Qining Qining commented Sep 7, 2018

This is another approach to do the same thing as #2179

@Qining Qining changed the title Another to drop raw bytes of the capture data Another way to drop raw bytes of the capture data Sep 7, 2018
@Qining
Copy link
Contributor Author

Qining commented Sep 13, 2018

@ben-clayton Any suggestions about this CL?

Copy link
Contributor

@ben-clayton ben-clayton left a comment

Choose a reason for hiding this comment

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

Sorry for the slow review.
I like this solution. Good stuff!
Please can you squash the top two CLs? Having the intermediate form appears to serve no purpose and just litters the git history.

@@ -266,6 +267,32 @@ func (c *Capture) Export(ctx context.Context, w io.Writer) error {
return e.encode(ctx)
}

type Source interface {
Copy link
Contributor

Choose a reason for hiding this comment

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

Docs please.

bytes.Reader
}

func (brc *blobReadCloser) Close() error {
Copy link
Contributor

Choose a reason for hiding this comment

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

Übernit: You can drop the brc * bit of the receiver.

}

func (b *Blob) ReadCloser() (io.ReadCloser, error) {
return &blobReadCloser{*bytes.NewReader(b.GetData())}, nil
Copy link
Contributor

Choose a reason for hiding this comment

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

Übernit: Make bytes.Reader field a pointer (*bytes.Reader), you can drop the indirection stuff:

return blobReadCloser{bytes.NewReader(b.GetData())}, nil

@Qining Qining force-pushed the another-way-do-not-cache-capture-data branch from e65364b to 41cb2b7 Compare September 18, 2018 17:39
@Qining
Copy link
Contributor Author

Qining commented Sep 18, 2018

Yep, I always squash and rebase for CLs.

@Qining Qining merged commit 5bf4a56 into google:master Sep 18, 2018
ben-clayton added a commit to ben-clayton/gapid that referenced this pull request Sep 19, 2018
ben-clayton added a commit that referenced this pull request Sep 19, 2018
@Qining Qining deleted the another-way-do-not-cache-capture-data branch October 23, 2018 17:26
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.

2 participants