Skip to content

Instantly share code, notes, and snippets.

// a sample representation of a user in Cassandra
usersTable = { // table for user data
'phatduckk' : { // row w/ key "phatduckk"
'addresses' : { // column family of type "Super"
"work" : { "street" : "12345 Main street", 'city': "San Francisco", "state" : "CA", "zip": "90210" }, // column family
"home" : { "street" : "7 Foobar street", 'city': "San Mateo", "state" : "CA", "zip": "94666" } // column family
},
'socialNetworks' : { // column family of type "Super"
"com.digg" : {"url" : "http://digg.com/users/phatduckk", "rss": "http://digg.com/users/phatduckk"}, // column family
// Pageview/click analytics in Cassandra?
pageAnalytics = {
"come.foo/index.html" : { // super column family
"pageviews": { // Super Column family
"someuuid" : {"cookie": "OH HAI", "url": "come.foo/index.html", "layout": 47, "ip": "1.2.3.4"},
"someuuid2" : {"cookie": "OH HAI", "url": "come.foo/index.html", "layout": 47, "ip": "1.2.3.4"},
},
"clicks": { // Super Column family
"someuuid" : {"cookie": "OH HAI", "target": "http://interiorcrocodilealligator.com/", "layout": 47, "ip": "1.2.3.4", "x" : 120, "y": 375},
CFLAGS="-arch x86_64" \
./configure \
--with-apxs2=/usr/sbin/apxs --prefix=/usr/local/php5.2.8 --with-config-file-scan-dir=/usr/local/php5.2.8/php.d \
--with-config-file-path=/usr/local/php5.2.8/php.d \
--disable-posix \
--enable-cli \
--with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config \
--with-jpeg-dir=/opt/local/include --with-png-dir=/opt/local/include --enable-gd-native-ttf --with-freetype-dir=/usr/local/php5.2.8 \
--with-zlib \
--enable-pdo --with-pdo-sqlite --with-sqlite=shared --enable-sqlite-utf8 \
<?php
$ch = curl_init("http://phatduckk.com");
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$res = curl_exec($ch);
$info = curl_getinfo($ch);
echo "final url: {$info['url']}\n";
-Dcassandra -Dstorage-config=conf -Dcassandra-foreground
Arin@arin Cassandra{arin}$ nosetests
EFEFEEEEEFEEEFEEEFEFEFEFEFEFEEEEEEEEFEFEFE
======================================================================
ERROR: system.test_server.TestMutations.test_bad_calls
----------------------------------------------------------------------
Traceback (most recent call last):
File "/opt/local/lib/python2.5/site-packages/nose-0.11.1-py2.5.egg/nose/case.py", line 367, in tearDown
try_run(self.inst, ('teardown', 'tearDown'))
File "/opt/local/lib/python2.5/site-packages/nose-0.11.1-py2.5.egg/nose/util.py", line 487, in try_run
return func()
Arin@arin cassandra-trunk$ ls
BUGS.txt bin junitvmwatcher2676273624541453260.properties
CHANGES.txt build lib
DISCLAIMER.txt build.xml src
LICENSE.txt conf test
NOTICE.txt interface
README.txt junit3247500251065907469.properties
Arin@arin cassandra-trunk$ nosetests
.FFEEEEFEEEFEFF.EEEEEE
======================================================================
VBoxManage setextradata debian "VBoxInternal/Devices/pcnet/0/LUN#0/Config/ssh/HostPort" 2222
VBoxManage setextradata debian "VBoxInternal/Devices/pcnet/0/LUN#0/Config/ssh/GuestPort" 22
VBoxManage setextradata debian "VBoxInternal/Devices/pcnet/0/LUN#0/Config/ssh/Protocol" TCP
Arin@arin cassandra-arin{CASSANDRA-212}$ nosetests
........E..........EE...
======================================================================
ERROR: system.test_server.TestMutations.test_empty_range
----------------------------------------------------------------------
Traceback (most recent call last):
File "/opt/local/lib/python2.5/site-packages/nose-0.11.1-py2.5.egg/nose/case.py", line 183, in runTest
self.test(*self.arg)
File "/Volumes/ndo/services/cassandra-arin/test/system/test_server.py", line 303, in test_empty_range
assert client.get_key_range('Table1', 'Standard1', '', '', 1000) == []
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ {\1}/'
}
export PS1="\[\e[36;1m\]\u@\[\e[32;1m\]\H\e[0m:\[\e[0m\]\e[35;1m\w\e[33;1m\]$(parse_git_branch)\e[0m > \[\e[0m\]"