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

A new stat for bytes read off the disk #117

Merged
merged 1 commit into from
Jul 13, 2022

Conversation

Thejas-bhat
Copy link
Contributor

@Thejas-bhat Thejas-bhat commented Jun 9, 2022

No description provided.

@Thejas-bhat Thejas-bhat marked this pull request as ready for review June 30, 2022 13:02
Copy link
Contributor

@sreekanth-cb sreekanth-cb left a comment

Choose a reason for hiding this comment

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

.

// set the data offset
fdvIter.dvDataLoc = fieldDvLocStart

return fdvIter, nil
}

func (di *docValueReader) BytesRead() uint64 {
Copy link
Contributor

Choose a reason for hiding this comment

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

commentary indicating that these methods are an interface implementation and the reference to that interface here would be useful.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done.

intDecoder.go Outdated
rv.dataStartOffset = offset + n
return rv
}

func (d *chunkedIntDecoder) bytesOffDisk() uint64 {
Copy link
Contributor

Choose a reason for hiding this comment

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

older func name (bytesOffDisk) lingering around?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done.

@@ -331,19 +346,35 @@ func (i *PostingsIterator) Size() int {
return sizeInBytes
}

func (i *PostingsIterator) SetBytesRead(val uint64) {
Copy link
Contributor

Choose a reason for hiding this comment

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

commentary for the interface implementations..

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done.

intDecoder.go Outdated
rv.dataStartOffset = offset + n
return rv
}

func (d *chunkedIntDecoder) BytesRead() uint64 {
Copy link
Member

Choose a reason for hiding this comment

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

Similar commentary here like with docValueReader.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done.

// interface, as the intention is to retrieve the bytes
// read from the on-disk segment as part of the current
// query.
func (s *Segment) SetBytesRead(val uint64) {
Copy link
Member

Choose a reason for hiding this comment

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

Now that I'm looking at this - feels a bit distasteful to allow another library to just overwrite this parameter.

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree with you @abhinavdangeti,
@Thejas-bhat ,

Why do we need this API? This would be inherent task within the merge process.
Meaning the the merge process would take care of tracking the prev_bytes from segments and carrying it further to the newly formed segment.

Wouldn't that suffice the requirement?

Copy link
Contributor

Choose a reason for hiding this comment

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

hm.. it may not possible without making disk format changes.

@@ -96,6 +97,7 @@ func (s *SegmentBase) loadFieldDocValueReader(field string,
chunkOffsetsLen := binary.BigEndian.Uint64(s.mem[fieldDvLocEnd-16 : fieldDvLocEnd-8])
// acquire position of chunk offsets
chunkOffsetsPosition = (fieldDvLocEnd - 16) - chunkOffsetsLen
s.bytesRead += uint64(16)
Copy link
Member

Choose a reason for hiding this comment

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

Some commentary here on why 16 here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done.

Copy link
Contributor

@sreekanth-cb sreekanth-cb left a comment

Choose a reason for hiding this comment

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

looks ok to me.

segment.go Outdated Show resolved Hide resolved
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