This file contains 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 hashlib | |
def string_to_deterministic_float(s: str) -> float: | |
""" | |
Given a string, deterministically map it to a uniformly sampled float in range [0.0, 1.0). | |
""" | |
b = bytes(s, encoding='utf-8') | |
h_dig = hashlib.sha256(b).hexdigest() | |
return int(h_dig, base=16) / 16 ** len(h_dig) |
This file contains 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 hashlib | |
def string_to_deterministic_float(s: str) -> float: | |
""" | |
Given a string, deterministically convert it to a range [0.0, 1.0). | |
""" | |
b = bytes(s, encoding='utf-8') | |
h_dig = hashlib.sha256(b).hexdigest() | |
return int(h_dig, base=16) / 16 ** len(h_dig) |
This file contains 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
from collections import OrderedDict | |
import os | |
import bs4 | |
import requests | |
import re | |
import json | |
from requests.adapters import HTTPAdapter | |
from urllib3 import Retry |
This file contains 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
#!/bin/bash | |
# Script to run hadoop terasort benchmark specified amount of times, getting the average runtime for all 3 stages. | |
# | |
# To run via ssh, say on Jenkins, wrap in: | |
# ssh namenode.server.com <<'ENDSSH' | |
# (... code ...) | |
# ENDSSH | |
readonly EXAMPLES_JAR="(...)/hadoop-mapreduce-examples.jar" |
This file contains 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
#!/bin/bash | |
# | |
# Run DFSIO write and read tests for multiple file size/count configurations. Get the average speed over RUNS_PER_CONFIG executions. | |
# The throughtput calculation method assumes all tests are run on a single 'wave' , i.e. BATCH_SIZE < total mapper task | |
# | |
# Replace hadoop/yarn in run commands as required. | |
# | |
# To run via ssh, say on Jenkins, wrap in: | |
# ssh namenode.server.com <<'ENDSSH' |
This file contains 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
sudo apt-get install python-dev cython git python-pip | |
sudo pip install git+git://github.com/ellimilial/gevent.git@master |