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
javascript:(function(){'use strict';var _temporalUndefined={};function _temporalAssertDefined(val,name,undef){if(val===undef){throw new ReferenceError(name+' is not defined - temporal dead zone');}return true;}(function(){'use strict';var els=_temporalUndefined;var allCustomElements=_temporalUndefined;var polymerRegisteredElements=_temporalUndefined;var diff=_temporalUndefined;function isCustomEl(el){return el.localName.indexOf('-')!=-1||el.getAttribute('is');}els=[].slice.call(document.querySelectorAll('html /deep/ *')).filter(function(el){return isCustomEl(el);}).map(function(el){return el.getAttribute('is')||el.localName;});allCustomElements=new Set(_temporalAssertDefined(els,'els',_temporalUndefined)&&els);polymerRegisteredElements=Polymer.telemetry.registrations.map(function(el){return el.is;}).filter(function(name){var blacklist=_temporalUndefined;blacklist=['dom-template','array-selector','custom-style'];return(_temporalAssertDefined(blacklist,'blacklist',_temporalUndefined)&&blacklist).indexOf(name)== |
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
from pyspark.sql import SQLContext | |
sql = SQLContext(sc) | |
mysql_movies = sql.read.jdbc("jdbc:mysql://127.0.0.1:3307/movielens?user=root", "movielens.movies") | |
mysql_movies.write.format("org.apache.spark.sql.cassandra").options(table="movies", keyspace="lens").save(mode="append") |
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
#!/bin/bash | |
# Backup the repositories indicated in the command line | |
# Example: | |
# bin/backup user1/repo1 user1/repo2 | |
set -e | |
for i in $@; do | |
FILENAME=$(echo $i | sed 's/\//-/g') | |
echo "== Backing up $i to $FILENAME.bak" | |
git clone [email protected]:$i $FILENAME.git --mirror | |
cd "$FILENAME.git" |
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
"""Extract mean, median and percentiles from `nodetool cfhistogram` output. | |
Usage: | |
1. Run this script. | |
2. Paste in the output from a read or write latency histograms. | |
3. Press CTRL+D (to close stdin file descriptor). | |
""" | |
import sys | |
import collections |
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
#!/bin/bash | |
KEYSPACE=$1 | |
DATE=`date +"%Y-%m-%d--%H-%M-%S"` | |
FOLDER_NAME=${DATE}-daily | |
S3_BUCKET=s3://YOUR-S3-BUCKET | |
S3_BUCKET_PATH=cassandra/full/`date +"%Y/%m/%d/%H/%M"`/`cat /etc/hostname` | |
SNAPSHOTID=`uuidgen --time` | |
PGP_KEY_RECIPIENT=YOUR-PGP-KEY-RECIPIENT |
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
#!/bin/bash | |
# | |
# Counts number of tombstones per partition key in one or multiple sstables. | |
# | |
# Usage: ./tombstone-count.sh /var/lib/cassandra/data/mykeyspace/mytable/*-Data.db | |
# | |
# Sample output: | |
# "40e6a9839bf44bdaa624cc53e96733fe" 8 | |
# "8e177ab222c14f868bcb6d2922b18d2b" 8 | |
# "28aaa9db0dad4ae78cabe8bcc25d14a3" 9 |