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

Index sections #159

Closed
wants to merge 9 commits into from
Closed

Conversation

Thejas-bhat
Copy link
Member

work in progress

io.init = true
}

if fieldID == ^uint16(0) {
Copy link
Member

Choose a reason for hiding this comment

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

Would you add some commentary around when fieldID is set to this - which should be math.MaxUint16.

Copy link
Member Author

Choose a reason for hiding this comment

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

yeah, i'll be adding commentary to certain portions of the changes in the coming commits.

segment.go Outdated
numDocs uint64
storedIndexOffset uint64
fieldsIndexOffset uint64
newFieldsIndexOffset uint64
Copy link
Member

Choose a reason for hiding this comment

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

I suppose the reason you kept newFieldsIndexOffset along side fieldsIndexOffset is for backward compatibility? The new attribute could use a better name implying sections are in play.

Copy link
Member Author

Choose a reason for hiding this comment

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

it was more related to the fact that the newFieldsIndexOffset relates to information that has fieldsIndex info tagged alongside the section type informations.

@@ -294,6 +312,69 @@ func (s *SegmentBase) loadFields() error {
return nil
}

func (s *SegmentBase) loadFieldsNew() error {
Copy link
Member

Choose a reason for hiding this comment

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

Same here - name to indicate sections.

Or perhaps it'd be cleaner to declare a new struct which comes with new attributes and methods -

type SegmentBase struct {
    // leave as is
}

type SegmentBaseV2 struct {
    SegmentBase

    sectionFieldsIndexOffset uint64
    ...
}

func (s *SegmentBaseV2) loadSectionFields() error {

}

type Segment struct {
    SegmentBaseV2

    ...
}

If this can cause way too much of refactoring, you can ditch it. Thoughts?

Copy link
Member Author

Choose a reason for hiding this comment

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

oh cool, thanks! I'll think more on these lines and get back to you on this.

@Thejas-bhat
Copy link
Member Author

duplicate of #165

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