Skip to content

Instantly share code, notes, and snippets.

@papercompute
Created July 30, 2014 11:58
Show Gist options
  • Select an option

  • Save papercompute/245a8405b97b0b1b3679 to your computer and use it in GitHub Desktop.

Select an option

Save papercompute/245a8405b97b0b1b3679 to your computer and use it in GitHub Desktop.
hadoop Makefile
TARGET_JAR = SumCount
TARGET_CLASS = $(TARGET_JAR)
INPUT = input.txt
OUTPUT = output
all:$(TARGET_JAR)
$(TARGET_JAR):
javac -cp "`hadoop classpath`" *.java -d classes
jar -cvf $(TARGET_JAR).jar -C classes ./
run:
rm -rf $(OUTPUT)
hadoop jar $(TARGET_JAR).jar $(TARGET_CLASS) $(INPUT) $(OUTPUT)
cat $(OUTPUT)/part-r-00000
res:
cat $(OUTPUT)/part-r-00000
clean:
rm -rf *.jar
rm -rf *~ *class
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment