Skip to content

Instantly share code, notes, and snippets.

View sujee's full-sized avatar

Sujee Maniyam sujee

View GitHub Profile
@sujee
sujee / gist:ff14fd602b76314e693d
Created August 17, 2014 05:20
play + spark error message
[info] application - ### Application has started
[info] play - Application started (Dev)
spark.app.name=Spark And Play
spark.home=/Users/sujee/hadoop/spark-1.0.2-hadoop2
spark.jars=/Users/sujee/dev/play-spark/target/scala-2.10/play-spark_2.10-1.0.jar
spark.master=spark://localhost:7077
[error] a.a.OneForOneStrategy - exception during creation
akka.actor.ActorInitializationException: exception during creation
at akka.actor.ActorInitializationException$.apply(Actor.scala:164) ~[akka-actor_2.10-2.3.4.jar:na]
at akka.actor.ActorCell.create(ActorCell.scala:596) ~[akka-actor_2.10-2.3.4.jar:na]
#!/bin/bash
## usage:
## cluster-cmd.sh <-h hosts_file> [-u user] cmd
## cluster-cmd.sh -h hosts ls -la
function usage()
{
echo "usage : $0 -h <hosts file> [-u user] [-i ssh_key_file] cmd"
exit 1
#!/usr/bin/env bash
## XXX
export JAVA_HOME=/opt/java
if [[ `uname -a` == Darwin* ]]; then
# Assuming Mac OS X
export JAVA_HOME=${JAVA_HOME:-$(/usr/libexec/java_home)}
export TACHYON_RAM_FOLDER=/Volumes/ramdisk
export TACHYON_JAVA_OPTS="-Djava.security.krb5.realm= -Djava.security.krb5.kdc="
// MembaseTest1
package tutorial;
import java.net.InetSocketAddress;
import net.spy.memcached.MemcachedClient;
/**
* Write / Read from Membase
*
* @author sujee
*
// MembaseTest3
package tutorial;
import java.net.InetSocketAddress;
import java.util.concurrent.TimeUnit;
import net.spy.memcached.MemcachedClient;
/**
* simulates writing / reading from two different clients
// MembaseTest2
package tutorial;
import java.net.InetSocketAddress;
import net.spy.memcached.MemcachedClient;
/**
* simulates writing / reading from two different clients
*/
public class MembaseTest2
...
...
long t2 = System.currentTimeMillis();
cache.shutdown(10, TimeUnit.SECONDS); // graceful shutdown
System.out.println("Time for " + MAX + " puts is " + (t2 - t1) + " ms");
// open another connection
cache = new MemcachedClient(new InetSocketAddress(server, port));
...
...
@sujee
sujee / amazon-emr-compile.sh
Created January 2, 2011 05:13
amazon-emr-compile.sh : compile script to create a single JAR for Amazon EMR
#!/bin/bash
## http://sujee.net/tech/articles/amazon-emr-beyond-basics/
CLASS_DIR=classes
mkdir -p $CLASS_DIR
rm -rf $CLASS_DIR/*
# compile
@sujee
sujee / amazon-emr-testMR.java
Created January 2, 2011 05:29
TestMR.java : basic map reduce program that takes input path as an argument
/**
* http://sujee.net/tech/articles/amazon-emr-beyond-basics/
* takes one argument for input path
*/
public class TestMR extends Configured implements Tool
{
public static void main(String[] args) throws Exception
{
int res = ToolRunner.run(new Configuration(), new TestMR(), args);
@sujee
sujee / run-emr-testMR.sh
Created January 2, 2011 05:40
run-emr-TestMR.sh : launches an MR job on EMR
#!/bin/bash
## http://sujee.net/tech/articles/amazon-emr-beyond-basics/
# config
# if changing machine type, also change mapred config file
MASTER_INSTANCE_TYPE="m1.large"
SLAVE_INSTANCE_TYPE="c1.xlarge"
INSTANCES=5
export JOBNAME="MyMR"
export TIMESTAMP=$(date +%Y%m%d-%H%M%S)