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
import ( | |
"github.com/spaolacci/murmur3" | |
"math" | |
) | |
/** | |
Places a string in a bucket in a uniform distribution where B is the number of bucket using Murmur hashing function for 64 bit | |
**/ | |
func PlaceInUniformBucket(str string, B int) (int, error) { | |
h64 := murmur3.New64() | |
_, err := h64.Write([]byte(str)) |
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
package main | |
import ( | |
"gopkg.in/olivere/elastic.v3" | |
"log" | |
"os" | |
"time" | |
"math" | |
) | |
type Obj struct { |