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

remove seed variable in BloomFilter and rename k to hashIndex #557

Merged
merged 3 commits into from Dec 3, 2016

Conversation

sritchie
Copy link
Collaborator

Same as #220!

I'm GUESSING this might not be legit - do we want to nuke the seed, or do we want to actually try and use it?

@sritchie
Copy link
Collaborator Author

(fails binary compatibility check, of course)

@johnynek
Copy link
Collaborator

I think this is a good PR. we accepted this implementation as a contribution and didn't look back too much (or at least accepted a revamp of it).

This looks like a good improvement. I don't know why you need a seed, except to perhaps salt the hash function, for a reason I don't know. Maybe to allow multiple independent blooms, but why not just use one bigger one there, I'm sure it would perform better?

In any case. I would say merge this on the next binary break (which will be when we merge #523

@@ -361,19 +361,19 @@ case class BFHash(numHashes: Int, width: Int, seed: Long = 0L) extends Function1
(upper, lower)
}

private def nextHash(bytes: Array[Byte], k: Int, digested: Seq[Int] = Seq.empty): Stream[Int] = {
if (k == 0)
private def nextHash(bytes: Array[Byte], hashIndex: Int, digested: Seq[Int] = Seq.empty): Stream[Int] = {

Choose a reason for hiding this comment

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

we should optimize this. This is terrible using Stream here.

Paging @non

@johnynek
Copy link
Collaborator

johnynek commented Dec 2, 2016

looks like we need to remove mima for the tests.

@isnotinvain
Copy link
Contributor

What gets used instead of the passed in seed? A fixed default one? Only thing I can think of is unit tests wanting a fixed seed or something?

@johnynek
Copy link
Collaborator

johnynek commented Dec 3, 2016 via email

@isnotinvain
Copy link
Contributor

Oh I see, there's no randomness involved in the first place right?

@sritchie
Copy link
Collaborator Author

sritchie commented Dec 3, 2016

@isnotinvain yup, that's correct

@sritchie
Copy link
Collaborator Author

sritchie commented Dec 3, 2016

Nice, This failed because the doc compilation failed!

@johnynek
Copy link
Collaborator

johnynek commented Dec 3, 2016 via email

@johnynek
Copy link
Collaborator

johnynek commented Dec 3, 2016

👍

@sritchie sritchie merged commit 534bdfb into develop Dec 3, 2016
@sritchie sritchie deleted the sritchie/remove_seed branch December 3, 2016 03:06
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

5 participants