- Install DSE
- In the cassandra.yml file, ensure the datacenter and cluster match your analytics datacenter
- In the cassandra-env.sh file add this configuration line toward the bottom
JVM_OPTS="$JVM_OPTS -Dcassandra.join_ring=false"
This will make your DSE node a coordinator only, it will not own any data. You can use this node to submit jobs to DSE locally without the need to know which is the master node. - start DSE
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 boto.ec2 | |
def get_running_instances(region): | |
ec2 = boto.ec2.connect_to_region(region) | |
instances = [i for r in ec2.get_all_reservations() for i in r.instances] | |
return filter(lambda i: i.state == 'running', instances) | |
def get_reserved_instances(region): | |
ec2 = boto.ec2.connect_to_region(region) | |
reserved_instances = ec2.get_all_reserved_instances() |
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
#!/usr/bin/env python | |
from __future__ import print_function | |
import json | |
import logging | |
from urllib2 import Request, urlopen, URLError, HTTPError | |
from base64 import b64decode |
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
#!/usr/bin/env python | |
from __future__ import print_function | |
import json | |
import logging | |
import re | |
from base64 import b64decode, b64encode | |
from urllib2 import Request, urlopen, URLError, HTTPError |
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 fileinput, re, operator | |
from collections import Counter | |
def sizeof_fmt(num, suffix='B'): | |
for unit in ['', 'Ki', 'Mi', 'Gi', 'Ti', 'Pi', 'Ei', 'Zi']: | |
if abs(num) < 1024.0: | |
return "%3.1f%s%s" % (num, unit, suffix) | |
num /= 1024.0 | |
return "%.1f%s%s" % (num, 'Yi', suffix) |
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
#!/usr/bin/env python | |
""" | |
Counts the number of tombstones in a keyspace.table and reports the top N highest counts | |
tombstone_count.py | |
[-h] This help screen | |
[--data-dir DATA_DIR] The C* data directory (/var/lib/cassandra/data) | |
[--top-k TOP_K] The top number of keys with highest tombstone counts to display. | |
keyspace The keyspace that contains the table |
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
class TunableRetryPolicy(RetryPolicy): | |
""" A retry policy that allows you to decide if you want to downgrade consistency before | |
attempting to retry, additionally, you can specify the number of retries to try | |
""" | |
def __init__(self, read_retries=3, write_retries=3, downgrade_consistency=True): | |
self._read_retries = read_retries | |
self._write_retries = write_retries | |
self._downgrade_consistency = downgrade_consistency |
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
ui: mocha-qunit | |
browsers: | |
- name:chrome | |
- version: latest | |
scripts: | |
- "http://d8rk54i4mohrb.cloudfront.net/js/reach.js" | |
server: ./server.js |
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
class Result(threading.Event): | |
exception = None | |
def execute(): | |
cql = 'select * from events limit 10' | |
response = Result() | |
def _on_error(error): | |
response.exception = error |
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
for args in tables_for_load: | |
thread = FileLoaderWorker(*args) | |
thread.start() | |
completed = 0 | |
while completed < len(tables_for_load): | |
try: | |
response, exception = response_queue.get(block=False, timeout=0.1) | |
if exception: |
NewerOlder