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

Random keys #6

Merged
merged 1 commit into from
Oct 5, 2015
Merged

Random keys #6

merged 1 commit into from
Oct 5, 2015

Conversation

surajacharya
Copy link
Contributor

No description provided.

}
next, err = it.Next()
if err != nil {
return nil, err
}
}
lastFound := found-1
Copy link
Contributor

Choose a reason for hiding this comment

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

this pads out the sample by repeating the last one?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes. Without it you end up with a bunch of nil keys at the end. The scala
code rewinds the cursor, which is not great either. I might switch to using
reservoir sampling.

On Mon, Oct 5, 2015 at 7:58 AM, David Taylor notifications@github.com
wrote:

In rpc.go
#6 (comment):

        }
        next, err = it.Next()
        if err != nil {
            return nil, err
        }
    }
  •   lastFound := found-1
    

this pads out the sample by repeating the last one?


Reply to this email directly or view it on GitHub
https://github.com/foursquare/quiver/pull/6/files#r41153473.

Copy link
Contributor

Choose a reason for hiding this comment

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

As discussed offline, I think my preference would be to just return a smaller RandomKeys, e.g. buf[:found].

fewer keys might be returned than requested
dt added a commit that referenced this pull request Oct 5, 2015
return all the randomly picked keys
@dt dt merged commit 10fdb32 into foursquare:master Oct 5, 2015
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.

None yet

2 participants