fix: Implement random reader for generating data.#780
Merged
Conversation
vadmeste
reviewed
Aug 9, 2017
| currentReadBytes int | ||
| } | ||
|
|
||
| func (r *randomReader) Read(p []byte) (n int, err error) { |
Member
There was a problem hiding this comment.
Can you add some comments in this function ? @harshavardhana, it is little complicated to read
vadmeste
reviewed
Aug 9, 2017
|
|
||
| if n != int64(len(buf)) { | ||
| logger().Fatalf("Error: number of bytes does not match, want %v, got %v\n", len(buf), n) | ||
| if n != int64(MinPartSize) { |
Member
There was a problem hiding this comment.
If we are not using a random data source, then we get our data from 'datafile-65-MB' which means 65MB and not MinPartSize (64MB)
Member
Author
There was a problem hiding this comment.
Yes you are right .. looks like it was an existing problem too @vadmeste
364f9b1 to
1a14df6
Compare
krisis
requested changes
Aug 11, 2017
| return &randomReader{ | ||
| TotalBytes: int64(size), | ||
| RandomSeedChar: "a", | ||
| } |
Member
There was a problem hiding this comment.
we could remove code for counting bytes read by composing a simple random reader with io.LimitReader.
E.g,
return io.LimitReader{R: randomReader{seed: "a"}, N: size}where
type randomReader struct {
seed string
}
func (r *randomReader) Read (b []byte) (int, error) {
return copy(b, bytes.Repeat(r.seed, len(b))), nil
}18b23a6 to
68ac3f7
Compare
krisis
reviewed
Aug 12, 2017
|
|
||
| // Perform standard FPutObject with contentType provided (Expecting application/octet-stream) | ||
| n, err := c.FPutObject(bucketName, objectName+"-standard", fileName, objectContentType) | ||
| ny, err := c.FPutObject(bucketName, objectName+"-standard", fileName, objectContentType) |
68ac3f7 to
b7bf994
Compare
Member
|
@harshavardhana, it looks like functional tests are not passing Minio server log: |
Member
Author
Member
Author
|
@krisis any reviews? |
krisis
approved these changes
Aug 13, 2017
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #742