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
require 'riak' | |
@host = ARGV[0] | |
@port = ARGV[1].to_i | |
@bucket = ARGV[2] | |
@dir = ARGV[3] | |
@riak_client = Riak::Client.new(:host => @host, :http_port => @port) | |
@riak_bucket = @riak_client.bucket(@bucket) |
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
# Compile the module | |
~/src/riak_function_contrib/other/erlang# /usr/lib/riak/erts-5.7.5/bin/erlc bucket_importer.erl | |
# Move the module | |
~/src/riak_function_contrib/other/erlang# mv bucket_importer.beam /tmp/ | |
~/src/riak_function_contrib/other/erlang# riak attach | |
# riak attach | |
Attempting to restart script through sudo -u riak | |
Attaching to /tmp/riak/erlang.pipe.1 (^D to exit) |
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
class MyReducer extends Reducer[Text, Text, Text, Text] { | |
// How does one define a class level variable in Scala? Below does not work ... | |
var mo: MultipleOutputs[Context] | |
def setup(context : Context) { | |
mo = new MultipleOutputs(context) | |
} | |
def reduce(key : Text, values : java.util.Iterator[Text], context : Context) { |
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
# SCALA | |
[info] Loaded set in 112.9 | |
[info] Loaded set in 7.873 | |
[info] 9999999 intersects in 9.156 | |
# Node.js | |
10000000 inserted in 16 | |
10000000 matched in 8 |
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
#!/usr/bin/env ruby | |
require './rubydoop' | |
HADOOP_HOME = '/usr/local/Cellar/hadoop/0.21.0/libexec/' | |
map do |location, line| | |
line.split(/\s+/).each do |word| | |
next unless word.strip.length > 0 | |
emit word.strip.downcase.gsub(/^\(|[^a-zA-Z]$/, ''), location |
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
var sys = require('sys'), | |
nodeUnit = require('nodeunit'), | |
httputil = nodeUnit.utils.httputil, | |
sinon = require('sinon'), | |
logger = require('ain-tcp'); | |
module.exports = nodeUnit.testCase({ | |
setUp: function(callback) { | |
router = require('router').router; // using choreographer |
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
zmqd.c = 45k rps |
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
var zmq = require('zeromq'); | |
s = zmq.createSocket('push'); | |
s.connect('tcp://127.0.0.1:15000'); | |
while (true) { // ZOMG he did it again! | |
s.send(new Buffer("test")); | |
} |
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
require 'em-zeromq' | |
Thread.abort_on_exception = true | |
EM.run do | |
ctx = EM::ZeroMQ::Context.new(1) | |
socket = ctx.connect( ZMQ::PUSH, 'tcp://127.0.0.1:15000') | |
loop do # ZOMG you are blocking!? |
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
describe Telluride::Core::Drivers::SerfCity do | |
include EM::SpecHelper | |
before(:all) do | |
Integrator(:redis).start | |
end | |
after(:all) do | |
Inegrator(:redis).stop |