2013-07-10 18:42:18 +04:00
|
|
|
HBASE_CP ?= $(shell hbase classpath)
|
|
|
|
HADOOP_CP ?= $(shell hadoop classpath)
|
2013-03-21 12:50:31 +04:00
|
|
|
|
2013-03-07 09:12:37 +04:00
|
|
|
export HADOOP_USER_CLASSPATH_FIRST="true"
|
2013-03-07 00:02:18 +04:00
|
|
|
# this will need to change once more jars are added
|
2013-07-10 18:42:18 +04:00
|
|
|
export JACKSON_CP=jython-standalone-2.7-b1.jar:akela-0.5-SNAPSHOT.jar:jackson-core-2.1.4.jar:jackson-databind-2.1.4.jar:jackson-annotations-2.1.4.jar
|
|
|
|
export HADOOP_CLASSPATH := $(JACKSON_CP)
|
|
|
|
CP=$(HADOOP_CP):$(HBASE_CP):$(JACKSON_CP)
|
2013-03-07 09:12:37 +04:00
|
|
|
comma:=,
|
2013-06-18 00:10:52 +04:00
|
|
|
JAVA_SOURCE=$(addprefix org/mozilla/jydoop/,PythonWrapper.java PythonValue.java PythonKey.java HadoopDriver.java JacksonWrapper.java PySerializer.java)
|
|
|
|
TASK=HadoopDriver
|
2013-03-13 10:33:49 +04:00
|
|
|
ARGS=input output
|
2013-04-04 02:18:55 +04:00
|
|
|
SCRIPT=$(error Must specify SCRIPT=)
|
2013-04-19 03:28:35 +04:00
|
|
|
TEST_PY=test.py
|
2013-03-13 23:12:53 +04:00
|
|
|
all: driver.jar
|
2013-03-07 00:02:18 +04:00
|
|
|
|
2013-04-04 02:18:55 +04:00
|
|
|
check: driver.jar
|
2013-05-02 01:35:40 +04:00
|
|
|
java -cp driver.jar:$(CP) org.mozilla.jydoop.PythonWrapper $(TEST_PY)
|
2013-04-04 02:18:55 +04:00
|
|
|
|
2013-03-13 23:12:53 +04:00
|
|
|
run: driver.jar
|
2013-04-09 03:07:14 +04:00
|
|
|
java -cp driver.jar:$(CP) org.mozilla.jydoop.$(TASK)
|
2013-03-07 00:02:18 +04:00
|
|
|
|
2013-03-13 23:12:53 +04:00
|
|
|
hadoop: driver.jar
|
2013-07-10 18:42:18 +04:00
|
|
|
time hadoop jar $< org.mozilla.jydoop.$(TASK) -libjars $(subst :,$(comma),$(JACKSON_CP)) $(ARGS)
|
2013-03-07 00:02:18 +04:00
|
|
|
|
2013-04-20 23:07:01 +04:00
|
|
|
out/pylib:
|
|
|
|
mkdir -p out
|
|
|
|
ln -s ../pylib out/pylib
|
|
|
|
|
2013-04-04 20:27:20 +04:00
|
|
|
out/scripts:
|
|
|
|
mkdir -p out
|
|
|
|
ln -s ../scripts out/scripts
|
|
|
|
|
2013-04-20 22:02:36 +04:00
|
|
|
driver.jar: out/scripts out/pylib $(wildcard pylib/*.py scripts/*.py scripts/fhr/*.py) $(JAVA_SOURCE)
|
2013-03-22 06:27:37 +04:00
|
|
|
javac -Xlint:deprecation -d out -cp $(CP) $(JAVA_SOURCE)
|
2013-03-07 00:02:18 +04:00
|
|
|
jar -cvf $@ -C out .
|
|
|
|
|
|
|
|
%.class: ../%.java
|
2013-03-18 19:45:52 +04:00
|
|
|
|
|
|
|
download:
|
2013-03-21 13:38:37 +04:00
|
|
|
wget -c http://repo1.maven.org/maven2/org/python/jython-standalone/2.7-b1/jython-standalone-2.7-b1.jar -O jython-standalone-2.7-b1.jar
|
2013-04-06 20:35:28 +04:00
|
|
|
wget -c http://repo1.maven.org/maven2/com/fasterxml/jackson/core/jackson-core/2.1.4/jackson-core-2.1.4.jar -O jackson-core-2.1.4.jar
|
2013-03-21 13:38:37 +04:00
|
|
|
wget -c http://people.mozilla.org/~bsmedberg/akela-0.5-SNAPSHOT.jar -O akela-0.5-SNAPSHOT.jar
|
2013-05-02 05:03:08 +04:00
|
|
|
wget -c http://repo1.maven.org/maven2/com/fasterxml/jackson/core/jackson-databind/2.1.4/jackson-databind-2.1.4.jar -O jackson-databind-2.1.4.jar
|
|
|
|
wget -c http://repo1.maven.org/maven2/com/fasterxml/jackson/core/jackson-annotations/2.1.4/jackson-annotations-2.1.4.jar -O jackson-annotations-2.1.4.jar
|