Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

remove samples and update ref docs

  • Loading branch information...
commit 712f5aa980e5bbbb23b87ceb69128e190779ac39 1 parent d8649d6
mpollack authored
Showing with 7 additions and 2,180 deletions.
  1. +2 −6 docs/src/reference/docbook/samples/introduction.xml
  2. +5 −0 samples/README.txt
  3. +0 −37 samples/batch-wordcount/build.gradle
  4. +0 −40 samples/batch-wordcount/readme.txt
  5. +0 −11 samples/batch-wordcount/src/main/resources/META-INF/spring/batch-common.xml
  6. +0 −13 samples/batch-wordcount/src/main/resources/META-INF/spring/hadoop-context.xml
  7. +0 −35 samples/batch-wordcount/src/main/resources/META-INF/spring/wordcount-context.xml
  8. +0 −9 samples/batch-wordcount/src/main/resources/batch.properties
  9. +0 −27 samples/batch-wordcount/src/main/resources/cp-data.js
  10. +0 −6 samples/batch-wordcount/src/main/resources/hadoop.properties
  11. +0 −18 samples/batch-wordcount/src/main/resources/launch-context.xml
  12. +0 −9 samples/batch-wordcount/src/main/resources/log4j.properties
  13. +0 −45 samples/batch-wordcount/src/test/java/org/springframework/data/hadoop/samples/WordCountWorkflowTests.java
  14. +0 −12 samples/gradle.properties
  15. BIN  samples/gradle/wrapper/gradle-wrapper.jar
  16. +0 −6 samples/gradle/wrapper/gradle-wrapper.properties
  17. +0 −164 samples/gradlew
  18. +0 −90 samples/gradlew.bat
  19. +0 −35 samples/hbase-crud/build.gradle
  20. +0 −37 samples/hbase-crud/readme.txt
  21. +0 −166 samples/hbase-crud/src/main/java/org/springframework/data/hadoop/samples/hbase/HBaseAction.java
  22. +0 −45 samples/hbase-crud/src/main/java/org/springframework/data/hadoop/samples/hbase/Main.java
  23. +0 −24 samples/hbase-crud/src/main/resources/META-INF/spring/context.xml
  24. +0 −10 samples/hbase-crud/src/main/resources/hadoop.properties
  25. +0 −8 samples/hbase-crud/src/main/resources/log4j.properties
  26. +0 −53 samples/pig-scripting/build.gradle
  27. +0 −38 samples/pig-scripting/readme.txt
  28. +0 −29 samples/pig-scripting/src/main/java/org/springframework/data/hadoop/samples/pig/Main.java
  29. +0 −1  samples/pig-scripting/src/main/resources/.gitignore
  30. +0 −11 samples/pig-scripting/src/main/resources/META-INF/spring/batch-common.xml
  31. +0 −43 samples/pig-scripting/src/main/resources/META-INF/spring/context.xml
  32. +0 −3  samples/pig-scripting/src/main/resources/core-site.xml
  33. +0 −27 samples/pig-scripting/src/main/resources/cp-data.js
  34. +0 −8 samples/pig-scripting/src/main/resources/hadoop.properties
  35. +0 −22 samples/pig-scripting/src/main/resources/log4j.properties
  36. +0 −6 samples/pig-scripting/src/main/resources/script.pig
  37. +0 −39 samples/readme.txt
  38. +0 −836 samples/resources/data/nietzsche-chapter-1.txt
  39. +0 −30 samples/wordcount/build.gradle
  40. +0 −38 samples/wordcount/readme.txt
  41. +0 −45 samples/wordcount/src/main/java/org/springframework/data/hadoop/samples/wordcount/Main.java
  42. +0 −33 samples/wordcount/src/main/resources/META-INF/spring/context.xml
  43. +0 −27 samples/wordcount/src/main/resources/cp-data.js
  44. +0 −6 samples/wordcount/src/main/resources/hadoop.properties
  45. +0 −8 samples/wordcount/src/main/resources/log4j.properties
  46. +0 −24 samples/wordcount/src/test/java/org/springframework/data/hadoop/samples/WordCountWorkflowTests.java
View
8 docs/src/reference/docbook/samples/introduction.xml
@@ -1,10 +1,6 @@
<partintro>
<title>Document structure</title>
- <para>This part of the reference documentation covers the sample applications included with Spring for Apache Hadoop that demonstrate features in a code centric manner. </para>
+ <para>The sample applications have been moved into their own repository so they can be developed independently of the Spring for Apache Hadoop release cycle. They can be found on github <ulink url="https://github.com/SpringSource/spring-hadoop-samples">https://github.com/SpringSource/spring-hadoop-samples</ulink>.</para>
- <para><xref linkend="wordcount"/> describes a standard Spring application that executes the wordcount map-reduce job</para>
-
- <para><xref linkend="batch-wordcount"/> describes a Batch application that executes the wordcount map-reduce job</para>
-
-</partintro>
+</partintro>
View
5 samples/README.txt
@@ -0,0 +1,5 @@
+The samples applications have been moved into their own repository so they can be developed independently of the Spring for Apache Hadoop release cycle.
+
+They can be found on github:
+
+https://github.com/SpringSource/spring-hadoop-samples
View
37 samples/batch-wordcount/build.gradle
@@ -1,37 +0,0 @@
-description = 'Spring Hadoop Samples - Spring Batch WordCount'
-
-apply plugin: 'base'
-apply plugin: 'idea'
-apply plugin: 'java'
-apply plugin: 'eclipse' // `gradle eclipse` to generate .classpath/.project
-apply plugin: 'application'
-
-repositories {
- // Public Spring artefacts
- maven { url "http://repo.springsource.org/libs-snapshot" }
-}
-
-//load version from the root folder
-def props = new Properties();
-new File("../gradle.properties").withInputStream { props.load(it) }
-props.each({ project.ext[it.key] = it.value } )
-version = project.ext.version
-
-dependencies {
- compile "org.springframework.data:spring-data-hadoop:$version"
- compile "org.apache.hadoop:hadoop-examples:$hadoopVersion"
- compile "org.springframework.batch:spring-batch-core:$springBatchVersion"
- // update the version that comes with Batch
- compile "org.springframework:spring-tx:$springVersion"
-
- testCompile "junit:junit:$junitVersion"
- testCompile "org.springframework:spring-test:$springVersion"
-}
-
-sourceSets { main { resources { srcDir file('../resources') } } }
-
-run {
- args 'classpath:/launch-context.xml', 'job1'
-}
-mainClassName = "org.springframework.batch.core.launch.support.CommandLineJobRunner"
-defaultTasks 'run'
View
40 samples/batch-wordcount/readme.txt
@@ -1,40 +0,0 @@
-==========================
-== Batch WordCount Demo ==
-==========================
-
-1. MOTIVATION
-
-A basic word count demo that illustrates the configuration and interaction with the Hadoop through Spring Hadoop
-and Spring Batch. The demo copies local resources into HDFS and executes the Hadoop example that counts words
-against it. The demo requires a running Hadoop instance (by default at localhost:9000).
-The Hadoop settings can be configured through hadoop.properties (more info in the Spring Hadoop reference docs).
-
-2. BUILD AND DEPLOYMENT
-
-This directory contains the source files.
-For building, JDK 1.6+ are required
-
-a) To build and run the sample as a JUnit test, use the following command:
-
-*nix/BSD OS:
-$ ../gradlew
-
-Windows OS:
-$ ..\gradlew
-
-If you have Gradle installed and available in your classpath, you can simply type:
-$ gradle
-
-This launches the Spring Batch CommandLineJobRunner and triggers the job.
-
-3. IDE IMPORT
-
-To import the code inside an IDE run the command
-
-For Eclipse
-$ ../gradlew eclipse
-
-For IDEA
-$ ../gradlew idea
-
-This will generate the IDE specific project files.
View
11 samples/batch-wordcount/src/main/resources/META-INF/spring/batch-common.xml
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:p="http://www.springframework.org/schema/p"
- xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
-
- <bean id="jobRepository" class="org.springframework.batch.core.repository.support.MapJobRepositoryFactoryBean"/>
- <bean id="transactionManager" class="org.springframework.batch.support.transaction.ResourcelessTransactionManager"/>
- <bean id="jobLauncher" class="org.springframework.batch.core.launch.support.SimpleJobLauncher" p:jobRepository-ref="jobRepository"/>
-</beans>
-
View
13 samples/batch-wordcount/src/main/resources/META-INF/spring/hadoop-context.xml
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<beans:beans xmlns="http://www.springframework.org/schema/hadoop"
- xmlns:beans="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
- http://www.springframework.org/schema/hadoop http://www.springframework.org/schema/hadoop/spring-hadoop.xsd">
-
- <configuration>
- <!-- The value after the question mark is the default value if another value for hd.fs is not provided -->
- fs.default.name=${hd.fs:hdfs://localhost:9000}
- </configuration>
-
-</beans:beans>
View
35 samples/batch-wordcount/src/main/resources/META-INF/spring/wordcount-context.xml
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<beans:beans xmlns="http://www.springframework.org/schema/hadoop"
- xmlns:beans="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:batch="http://www.springframework.org/schema/batch"
- xsi:schemaLocation="http://www.springframework.org/schema/batch http://www.springframework.org/schema/batch/spring-batch-2.1.xsd
- http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
- http://www.springframework.org/schema/hadoop http://www.springframework.org/schema/hadoop/spring-hadoop.xsd">
-
- <batch:job id="job1">
- <batch:step id="import" next="wordcount">
- <batch:tasklet ref="script-tasklet"/>
- </batch:step>
-
- <batch:step id="wordcount">
- <batch:tasklet ref="wordcount-tasklet" />
- </batch:step>
- </batch:job>
-
- <job-tasklet id="wordcount-tasklet" job-ref="wordcount-job"/>
-
- <job id="wordcount-job" input-path="${wordcount.input.path:/user/gutenberg/input/word/}"
- output-path="${wordcount.output.path:/user/gutenberg/output/word/}"
- mapper="org.apache.hadoop.examples.WordCount.TokenizerMapper"
- reducer="org.apache.hadoop.examples.WordCount.IntSumReducer"
- validate-paths="false" />
-
- <script-tasklet id="script-tasklet">
- <script location="cp-data.js">
- <property name="inputPath" value="${wordcount.input.path}" />
- <property name="outputPath" value="${wordcount.output.path}" />
- <property name="localResource" value="${local.data}" />
- </script>
- </script-tasklet>
-
-</beans:beans>
View
9 samples/batch-wordcount/src/main/resources/batch.properties
@@ -1,9 +0,0 @@
-# Placeholders batch.*
-# for HSQLDB:
-batch.jdbc.driver=org.hsqldb.jdbcDriver
-batch.jdbc.url=jdbc:hsqldb:mem:testdb;sql.enforce_strict_size=true
-batch.jdbc.user=sa
-batch.jdbc.password=
-batch.schema=
-batch.schema.script=classpath:/org/springframework/batch/core/schema-hsqldb.sql
-
View
27 samples/batch-wordcount/src/main/resources/cp-data.js
@@ -1,27 +0,0 @@
-//
-// Simple script that prepares the HDFS env for a Hadoop job:
-//
-// 1. deletes the input/output paths in HDFS (in case they exist)
-// 2. copies a local resource to HDFS
-//
-// required params are:
-// * inputPath
-// * outputPath
-// * localResource
-
-
-// 'hack' default permissions to make Hadoop work on Windows
-if (java.lang.System.getProperty("os.name").startsWith("Windows")) {
- // 0655 = -rwxr-xr-x
- org.apache.hadoop.mapreduce.JobSubmissionFiles.JOB_DIR_PERMISSION.fromShort(0655)
- org.apache.hadoop.mapreduce.JobSubmissionFiles.JOB_FILE_PERMISSION.fromShort(0655)
-}
-
-
-// delete job paths
-if (fsh.test(inputPath)) { fsh.rmr(inputPath) }
-if (fsh.test(outputPath)) { fsh.rmr(outputPath) }
-
-// copy local resource using the streams directly (to be portable across envs)
-inStream = cl.getResourceAsStream(localResource)
-org.apache.hadoop.io.IOUtils.copyBytes(inStream, fs.create(inputPath), cfg)
View
6 samples/batch-wordcount/src/main/resources/hadoop.properties
@@ -1,6 +0,0 @@
-wordcount.input.path=/user/gutenberg/input/word/
-wordcount.output.path=/user/gutenberg/output/word/
-local.data=data/nietzsche-chapter-1.txt
-
-hd.fs=hdfs://localhost:9000
-mapred.job.tracker=localhost:9001
View
18 samples/batch-wordcount/src/main/resources/launch-context.xml
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:context="http://www.springframework.org/schema/context"
- xsi:schemaLocation="
- http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
- http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd">
-
- <context:property-placeholder location="classpath:batch.properties,classpath:hadoop.properties"
- ignore-resource-not-found="true" ignore-unresolvable="true" />
-
- <context:component-scan base-package="org.springframework.data.hadoop.samples" />
-
- <import resource="classpath:/META-INF/spring/batch-common.xml" />
- <import resource="classpath:/META-INF/spring/hadoop-context.xml" />
- <import resource="classpath:/META-INF/spring/wordcount-context.xml" />
-
-</beans>
View
9 samples/batch-wordcount/src/main/resources/log4j.properties
@@ -1,9 +0,0 @@
-log4j.rootCategory=INFO, stdout
-
-log4j.appender.stdout=org.apache.log4j.ConsoleAppender
-log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
-log4j.appender.stdout.layout.ConversionPattern=%d %p [%c] - <%m>%n
-
-log4j.logger.org.springframework.batch=WARN
-# for debugging datasource initialization
-# log4j.category.test.jdbc=DEBUG
View
45 ...rdcount/src/test/java/org/springframework/data/hadoop/samples/WordCountWorkflowTests.java
@@ -1,45 +0,0 @@
-package org.springframework.data.hadoop.samples;
-
-import java.util.Map;
-
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.springframework.batch.core.BatchStatus;
-import org.springframework.batch.core.Job;
-import org.springframework.batch.core.JobParameters;
-import org.springframework.batch.core.launch.JobLauncher;
-import org.springframework.beans.factory.BeanInitializationException;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.ApplicationContext;
-import org.springframework.test.context.ContextConfiguration;
-import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
-
-
-@RunWith(SpringJUnit4ClassRunner.class)
-@ContextConfiguration("/launch-context.xml")
-public class WordCountWorkflowTests {
-
- @Autowired
- private ApplicationContext ctx;
-
- @Test
- public void testWorkflowNS() throws Exception {
- startJobs(ctx);
- }
-
- public void startJobs(ApplicationContext ctx) {
- JobLauncher launcher = ctx.getBean(JobLauncher.class);
- Map<String, Job> jobs = ctx.getBeansOfType(Job.class);
-
- for (Map.Entry<String, Job> entry : jobs.entrySet()) {
- System.out.println("Executing job " + entry.getKey());
- try {
- if (launcher.run(entry.getValue(), new JobParameters()).getStatus().equals(BatchStatus.FAILED)){
- throw new BeanInitializationException("Failed executing job " + entry.getKey());
- }
- } catch (Exception ex) {
- throw new BeanInitializationException("Cannot execute job " + entry.getKey(), ex);
- }
- }
- }
-}
View
12 samples/gradle.properties
@@ -1,12 +0,0 @@
-junitVersion = 4.8.1
-springVersion = 3.0.7.RELEASE
-hadoopVersion = 1.0.3
-springBatchVersion = 2.1.8.RELEASE
-groovyVersion = 1.8.5
-jacksonVersion = 1.8.8
-hbaseVersion = 0.92.1
-pigVersion = 0.9.2
-antVersion = 1.8.3
-antlrVersion = 3.1
-
-version = 1.0.0.BUILD-SNAPSHOT
View
BIN  samples/gradle/wrapper/gradle-wrapper.jar
Binary file not shown
View
6 samples/gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +0,0 @@
-#Thu Oct 04 20:39:16 EEST 2012
-distributionBase=GRADLE_USER_HOME
-distributionPath=wrapper/dists
-zipStoreBase=GRADLE_USER_HOME
-zipStorePath=wrapper/dists
-distributionUrl=http\://services.gradle.org/distributions/gradle-1.2-bin.zip
View
164 samples/gradlew
@@ -1,164 +0,0 @@
-#!/usr/bin/env bash
-
-##############################################################################
-##
-## Gradle start up script for UN*X
-##
-##############################################################################
-
-# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
-DEFAULT_JVM_OPTS=""
-
-APP_NAME="Gradle"
-APP_BASE_NAME=`basename "$0"`
-
-# Use the maximum available, or set MAX_FD != -1 to use that value.
-MAX_FD="maximum"
-
-warn ( ) {
- echo "$*"
-}
-
-die ( ) {
- echo
- echo "$*"
- echo
- exit 1
-}
-
-# OS specific support (must be 'true' or 'false').
-cygwin=false
-msys=false
-darwin=false
-case "`uname`" in
- CYGWIN* )
- cygwin=true
- ;;
- Darwin* )
- darwin=true
- ;;
- MINGW* )
- msys=true
- ;;
-esac
-
-# For Cygwin, ensure paths are in UNIX format before anything is touched.
-if $cygwin ; then
- [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
-fi
-
-# Attempt to set APP_HOME
-# Resolve links: $0 may be a link
-PRG="$0"
-# Need this for relative symlinks.
-while [ -h "$PRG" ] ; do
- ls=`ls -ld "$PRG"`
- link=`expr "$ls" : '.*-> \(.*\)$'`
- if expr "$link" : '/.*' > /dev/null; then
- PRG="$link"
- else
- PRG=`dirname "$PRG"`"/$link"
- fi
-done
-SAVED="`pwd`"
-cd "`dirname \"$PRG\"`/"
-APP_HOME="`pwd -P`"
-cd "$SAVED"
-
-CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
-
-# Determine the Java command to use to start the JVM.
-if [ -n "$JAVA_HOME" ] ; then
- if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
- # IBM's JDK on AIX uses strange locations for the executables
- JAVACMD="$JAVA_HOME/jre/sh/java"
- else
- JAVACMD="$JAVA_HOME/bin/java"
- fi
- if [ ! -x "$JAVACMD" ] ; then
- die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
-
-Please set the JAVA_HOME variable in your environment to match the
-location of your Java installation."
- fi
-else
- JAVACMD="java"
- which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
-
-Please set the JAVA_HOME variable in your environment to match the
-location of your Java installation."
-fi
-
-# Increase the maximum file descriptors if we can.
-if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
- MAX_FD_LIMIT=`ulimit -H -n`
- if [ $? -eq 0 ] ; then
- if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
- MAX_FD="$MAX_FD_LIMIT"
- fi
- ulimit -n $MAX_FD
- if [ $? -ne 0 ] ; then
- warn "Could not set maximum file descriptor limit: $MAX_FD"
- fi
- else
- warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
- fi
-fi
-
-# For Darwin, add options to specify how the application appears in the dock
-if $darwin; then
- GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
-fi
-
-# For Cygwin, switch paths to Windows format before running java
-if $cygwin ; then
- APP_HOME=`cygpath --path --mixed "$APP_HOME"`
- CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
-
- # We build the pattern for arguments to be converted via cygpath
- ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
- SEP=""
- for dir in $ROOTDIRSRAW ; do
- ROOTDIRS="$ROOTDIRS$SEP$dir"
- SEP="|"
- done
- OURCYGPATTERN="(^($ROOTDIRS))"
- # Add a user-defined pattern to the cygpath arguments
- if [ "$GRADLE_CYGPATTERN" != "" ] ; then
- OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
- fi
- # Now convert the arguments - kludge to limit ourselves to /bin/sh
- i=0
- for arg in "$@" ; do
- CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
- CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
-
- if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
- eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
- else
- eval `echo args$i`="\"$arg\""
- fi
- i=$((i+1))
- done
- case $i in
- (0) set -- ;;
- (1) set -- "$args0" ;;
- (2) set -- "$args0" "$args1" ;;
- (3) set -- "$args0" "$args1" "$args2" ;;
- (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
- (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
- (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
- (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
- (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
- (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
- esac
-fi
-
-# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
-function splitJvmOpts() {
- JVM_OPTS=("$@")
-}
-eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
-JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
-
-exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
View
90 samples/gradlew.bat
@@ -1,90 +0,0 @@
-@if "%DEBUG%" == "" @echo off
-@rem ##########################################################################
-@rem
-@rem Gradle startup script for Windows
-@rem
-@rem ##########################################################################
-
-@rem Set local scope for the variables with windows NT shell
-if "%OS%"=="Windows_NT" setlocal
-
-@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
-set DEFAULT_JVM_OPTS=
-
-set DIRNAME=%~dp0
-if "%DIRNAME%" == "" set DIRNAME=.
-set APP_BASE_NAME=%~n0
-set APP_HOME=%DIRNAME%
-
-@rem Find java.exe
-if defined JAVA_HOME goto findJavaFromJavaHome
-
-set JAVA_EXE=java.exe
-%JAVA_EXE% -version >NUL 2>&1
-if "%ERRORLEVEL%" == "0" goto init
-
-echo.
-echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
-echo.
-echo Please set the JAVA_HOME variable in your environment to match the
-echo location of your Java installation.
-
-goto fail
-
-:findJavaFromJavaHome
-set JAVA_HOME=%JAVA_HOME:"=%
-set JAVA_EXE=%JAVA_HOME%/bin/java.exe
-
-if exist "%JAVA_EXE%" goto init
-
-echo.
-echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
-echo.
-echo Please set the JAVA_HOME variable in your environment to match the
-echo location of your Java installation.
-
-goto fail
-
-:init
-@rem Get command-line arguments, handling Windowz variants
-
-if not "%OS%" == "Windows_NT" goto win9xME_args
-if "%@eval[2+2]" == "4" goto 4NT_args
-
-:win9xME_args
-@rem Slurp the command line arguments.
-set CMD_LINE_ARGS=
-set _SKIP=2
-
-:win9xME_args_slurp
-if "x%~1" == "x" goto execute
-
-set CMD_LINE_ARGS=%*
-goto execute
-
-:4NT_args
-@rem Get arguments from the 4NT Shell from JP Software
-set CMD_LINE_ARGS=%$
-
-:execute
-@rem Setup the command line
-
-set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
-
-@rem Execute Gradle
-"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
-
-:end
-@rem End local scope for the variables with windows NT shell
-if "%ERRORLEVEL%"=="0" goto mainEnd
-
-:fail
-rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
-rem the _cmd.exe /c_ return code!
-if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
-exit /b 1
-
-:mainEnd
-if "%OS%"=="Windows_NT" endlocal
-
-:omega
View
35 samples/hbase-crud/build.gradle
@@ -1,35 +0,0 @@
-description = 'Spring Hadoop Samples - HBase CRUD'
-
-apply plugin: 'base'
-apply plugin: 'java'
-apply plugin: 'idea'
-apply plugin: 'eclipse'
-apply plugin: 'application'
-
-repositories {
- maven { url "http://repo.springsource.org/libs-snapshot-local" }
- maven { url "http://repo.springsource.org/libs-snapshot" }
-}
-
-//load version from the root folder
-def props = new Properties();
-new File("../gradle.properties").withInputStream { props.load(it) }
-props.each({ project.ext[it.key] = it.value } )
-version = project.ext.version
-
-dependencies {
- compile("org.springframework.data:spring-data-hadoop:$version") {
- exclude module: "hive-metastore"
- }
- compile "org.springframework:spring-tx:$springVersion"
- compile "org.apache.hadoop:hadoop-core:$hadoopVersion"
- compile "org.apache.hbase:hbase:$hbaseVersion"
- compile "javax.inject:javax.inject:1"
- compile "javax.annotation:jsr250-api:1.0"
-
- testCompile "junit:junit:$junitVersion"
- testCompile "org.springframework:spring-test:$springVersion"
-}
-
-mainClassName = "org.springframework.data.hadoop.samples.hbase.Main"
-defaultTasks 'run'
View
37 samples/hbase-crud/readme.txt
@@ -1,37 +0,0 @@
-=====================
-== HBase CRUD Demo ==
-=====================
-
-1. MOTIVATION
-
-A demo that illustrates use of HBase Java API through Spring Hadoop. The demo counts occurrences in an HBase table.
-The demo requires a running Hadoop instance (by default at localhost:9000) and a HBase instance (using default settings).
-Both the Hadoop & HBase settings can be configured through hadoop.properties (more info in the Spring Hadoop reference docs).
-
-2. BUILD AND DEPLOYMENT
-
-This directory contains the source files.
-For building, JDK 1.6+ are required
-
-a) To build, test and run the sample, use the following command:
-
-*nix/BSD OS:
-$ ../gradlew
-
-Windows OS:
-$ ..\gradlew
-
-If you have Gradle installed and available in your classpath, you can simply type:
-$ gradle
-
-3. IDE IMPORT
-
-To import the code inside an IDE run the command
-
-For Eclipse
-$ ../gradlew eclipse
-
-For IDEA
-$ ../gradlew idea
-
-This will generate the IDE specific project files.
View
166 ...s/hbase-crud/src/main/java/org/springframework/data/hadoop/samples/hbase/HBaseAction.java
@@ -1,166 +0,0 @@
-/*
- * Copyright 2011-2012 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.data.hadoop.samples.hbase;
-
-import javax.annotation.PostConstruct;
-import javax.inject.Inject;
-
-import org.apache.hadoop.conf.Configuration;
-import org.apache.hadoop.hbase.HColumnDescriptor;
-import org.apache.hadoop.hbase.HTableDescriptor;
-import org.apache.hadoop.hbase.client.Get;
-import org.apache.hadoop.hbase.client.HBaseAdmin;
-import org.apache.hadoop.hbase.client.HTable;
-import org.apache.hadoop.hbase.client.Increment;
-import org.apache.hadoop.hbase.client.Put;
-import org.apache.hadoop.hbase.client.Result;
-import org.apache.hadoop.hbase.util.Bytes;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.data.hadoop.hbase.HbaseTemplate;
-import org.springframework.data.hadoop.hbase.RowMapper;
-import org.springframework.data.hadoop.hbase.TableCallback;
-import org.springframework.stereotype.Component;
-
-/**
- * Demo class counting occurrances in HBase through SHDP HBaseTemplate.
- *
- * @author Costin Leau
- * @author Jarred Li
- */
-@Component
-public class HBaseAction {
-
- @Autowired
- private Configuration hbaseConfiguration;
-
- @Inject
- private HbaseTemplate t;
-
- String rowName = "row";
- String likeNumber = "likeCount";
- String linkAddress = "link";
- String columnFamilyName = "cf";
- String tableName = "likes";
- String cellValue = "http://blog.springsource.org/2012/02/29/introducing-spring-hadoop/";
-
- /**
- * Main entry point.
- */
- @PostConstruct
- public void run() throws Exception {
- //1. create table
- createTable();
-
- //2. put data
- addData();
-
- //3. increment
- increment();
-
- //4. get 1 column data
- readData();
-
- //5. scan data
- scanData();
- }
-
- /**
- * Creates HBase table
- *
- * @throws Exception
- */
- private void createTable() throws Exception {
-
- HBaseAdmin admin = new HBaseAdmin(hbaseConfiguration);
-
- if (admin.tableExists(tableName)) {
- admin.disableTable(tableName);
- admin.deleteTable(tableName);
- }
-
- HTableDescriptor tableDes = new HTableDescriptor(tableName);
-
- HColumnDescriptor cf1 = new HColumnDescriptor(columnFamilyName);
- tableDes.addFamily(cf1);
- admin.createTable(tableDes);
- }
-
-
- /**
- * Adds some sample data.
- */
- private void addData() {
- t.execute(tableName, new TableCallback<Object>() {
- public Object doInTable(HTable table) throws Throwable {
- for (int i = 0; i < 1000; i++) {
- Put p = new Put(Bytes.toBytes(rowName + i));
- p.add(Bytes.toBytes(columnFamilyName), Bytes.toBytes(linkAddress), Bytes.toBytes(cellValue + i % 7));
- table.put(p);
- }
- return null;
- }
- });
- }
-
-
-
- /**
- * Read data from table.
- *
- */
- private void readData() {
- // replace with get
- System.out.println(t.execute(tableName, new TableCallback<Long>() {
- public Long doInTable(HTable table) throws Throwable {
- Get get = new Get(Bytes.toBytes(rowName + "2"));
- Result result = table.get(get);
- byte[] valueByte = result.getValue(Bytes.toBytes(columnFamilyName), Bytes.toBytes(linkAddress));
- return Bytes.toLong(valueByte);
- }
- }));
- }
-
- /**
- * Update column values.
- */
- private void increment() {
- t.execute(tableName, new TableCallback<Object>() {
- public Object doInTable(HTable table) throws Throwable {
- for (int i = 0; i < 1000; i++) {
- Increment inc = new Increment(Bytes.toBytes(rowName + i));
- inc.addColumn(Bytes.toBytes(columnFamilyName), Bytes.toBytes(likeNumber), i % 10 + 1);
- table.increment(inc);
- }
- return null;
- }
- });
- }
-
-
- /**
- * Scan table data.
- *
- */
-
- private void scanData() {
- t.find(tableName, columnFamilyName, linkAddress, new RowMapper<String>() {
- public String mapRow(Result result, int rowNum) throws Exception {
- return Bytes.toString(result.value());
- }
- });
- }
-}
View
45 samples/hbase-crud/src/main/java/org/springframework/data/hadoop/samples/hbase/Main.java
@@ -1,45 +0,0 @@
-/*
- * Copyright 2011-2012 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.springframework.data.hadoop.samples.hbase;
-
-import org.springframework.context.support.AbstractApplicationContext;
-import org.springframework.context.support.ClassPathXmlApplicationContext;
-
-/**
- * WordCount startup class.
- * Bootstraps the Spring container which deploys and runs a Map-Reduce job.
- * <p/>
- * Accepts as optional parameters location of one (or multiple) application contexts that will
- * be used for configuring the Spring container. See the reference documentation for more
- * {@link http://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/html/resources.html information}.
- *
- * Note that in most (if not all) managed environments writing such a class is not needed
- * as Spring already provides the required integration.
- *
- * @see org.springframework.web.context.ContextLoaderListener
- * @author Costin Leau
- */
-public class Main {
-
- private static final String[] CONFIGS = new String[] { "META-INF/spring/context.xml" };
-
- public static void main(String[] args) {
- String[] res = (args != null && args.length > 0 ? args : CONFIGS);
- AbstractApplicationContext ctx = new ClassPathXmlApplicationContext(res);
- // shutdown the context along with the VM
- ctx.registerShutdownHook();
- }
-}
View
24 samples/hbase-crud/src/main/resources/META-INF/spring/context.xml
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:context="http://www.springframework.org/schema/context"
- xmlns:hdp="http://www.springframework.org/schema/hadoop"
- xmlns:p="http://www.springframework.org/schema/p"
- xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
- http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
- http://www.springframework.org/schema/hadoop http://www.springframework.org/schema/hadoop/spring-hadoop.xsd">
-
-
- <context:property-placeholder location="hadoop.properties"/>
-
- <hdp:configuration>
- fs.default.name=${hd.fs}
- </hdp:configuration>
-
- <hdp:hbase-configuration configuration-ref="hadoopConfiguration"/>
-
- <bean id="hTemplate" class="org.springframework.data.hadoop.hbase.HbaseTemplate" p:configuration-ref="hbaseConfiguration"/>
-
- <context:component-scan base-package="org.springframework.data.hadoop.samples.hbase"/>
-
-</beans>
View
10 samples/hbase-crud/src/main/resources/hadoop.properties
@@ -1,10 +0,0 @@
-hd.fs=hdfs://localhost:9000
-
-inputTable=likes
-outputTable=numberOfLikes
-rowName = "row"
-likeNumber = "likeCount"
-linkAddress = "link"
-columnFamilyName = "cf"
-tableName = "likes"
-cellValue = "http://blog.springsource.org/2012/02/29/introducing-spring-hadoop/"
View
8 samples/hbase-crud/src/main/resources/log4j.properties
@@ -1,8 +0,0 @@
-log4j.rootCategory=INFO, stdout
-
-log4j.appender.stdout=org.apache.log4j.ConsoleAppender
-log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
-log4j.appender.stdout.layout.ConversionPattern=%d %p [%c] - <%m>%n
-
-# for debugging datasource initialization
-# log4j.category.test.jdbc=DEBUG
View
53 samples/pig-scripting/build.gradle
@@ -1,53 +0,0 @@
-description = 'Spring Hadoop Samples - Running a Pig script'
-
-apply plugin: 'base'
-apply plugin: 'java'
-apply plugin: 'idea'
-apply plugin: 'eclipse'
-apply plugin: 'application'
-
-repositories {
- // Public Spring artefacts
- maven { url "http://repo.springsource.org/libs-snapshot" }
-}
-
-//load version from the root folder
-def props = new Properties();
-new File("../gradle.properties").withInputStream { props.load(it) }
-props.each({ project.ext[it.key] = it.value } )
-version = project.ext.version
-
-dependencies {
- compile "org.springframework.data:spring-data-hadoop:$version"
- compile "org.apache.hadoop:hadoop-examples:$hadoopVersion"
- compile "org.springframework.batch:spring-batch-core:$springBatchVersion"
- // update the version that comes with Batch
- compile "org.springframework:spring-tx:$springVersion"
- compile "org.apache.pig:pig:$pigVersion"
- runtime "jline:jline:0.9.94"
- runtime "com.google.guava:guava:r06"
- runtime "log4j:log4j:1.2.16"
- runtime "org.antlr:antlr-runtime:$antlrVersion"
-
- testCompile "junit:junit:$junitVersion"
- testCompile "org.springframework:spring-test:$springVersion"
-}
-
-task downloadSampleSet(type:Copy) {
- if (!new File('src/main/resources/ml-100k.zip').isFile()) {
- ant.get(src: 'http://www.grouplens.org/system/files/ml-100k.zip',
- dest: 'src/main/resources/', usetimestamp:true)
- }
- copy {
- from zipTree('src/main/resources/ml-100k.zip')
- into ('src/main/resources/')
- include 'ml-100k/u.data'
- exclude '**/*'
- }
-}
-
-sourceSets { main { resources { srcDir file('../resources') } } }
-
-run { args 'classpath:META-INF/spring/context.xml', 'pigJob' }
-mainClassName = "org.springframework.batch.core.launch.support.CommandLineJobRunner"
-defaultTasks 'run'
View
38 samples/pig-scripting/readme.txt
@@ -1,38 +0,0 @@
-======================
-== Pig Script Demo ==
-======================
-
-1. MOTIVATION
-
-The demo showcasing how to use Pig with Spring Hadoop. The demo requires a running Hadoop instance (by default at localhost:9000).
-The Hadoop settings can be configured through hadoop.properties (more info in the Spring Hadoop reference docs).
-
-2. BUILD AND DEPLOYMENT
-
-This directory contains the source files.
-For building, JDK 1.6+ are required
-
-a) To build, test and run the sample, use the following command:
-
-*nix/BSD OS:
-$ ../gradlew
-
-Windows OS:
-$ ..\gradlew
-
-If you have Gradle installed and available in your classpath, you can simply type:
-$ gradle
-
-This launches the Spring Batch CommandLineJobRunner and triggers the job.
-
-3. IDE IMPORT
-
-To import the code inside an IDE run the command
-
-For Eclipse
-$ ../gradlew eclipse
-
-For IDEA
-$ ../gradlew idea
-
-This will generate the IDE specific project files.
View
29 samples/pig-scripting/src/main/java/org/springframework/data/hadoop/samples/pig/Main.java
@@ -1,29 +0,0 @@
-package org.springframework.data.hadoop.samples.pig;
-
-import java.util.Queue;
-import java.util.concurrent.ArrayBlockingQueue;
-
-import org.springframework.batch.core.launch.support.CommandLineJobRunner;
-import org.springframework.batch.core.launch.support.SystemExiter;
-
-public class Main {
-
- public static void main(String[] args) throws Exception {
- final Queue<Integer> exitCode = new ArrayBlockingQueue<Integer>(1);
- CommandLineJobRunner.presetSystemExiter(new SystemExiter() {
- @Override
- public void exit(int status) {
- exitCode.add(status);
- }
- });
-
- CommandLineJobRunner.main(new String[] {
- "/META-INF/spring/context.xml",
- "pigJob"
- }
- );
-
- System.out.println("Exit code = " + exitCode.poll());
- }
-
-}
View
1  samples/pig-scripting/src/main/resources/.gitignore
@@ -1 +0,0 @@
-/ml-100k/
View
11 samples/pig-scripting/src/main/resources/META-INF/spring/batch-common.xml
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:p="http://www.springframework.org/schema/p"
- xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
-
- <bean id="jobRepository" class="org.springframework.batch.core.repository.support.MapJobRepositoryFactoryBean"/>
- <bean id="transactionManager" class="org.springframework.batch.support.transaction.ResourcelessTransactionManager"/>
- <bean id="jobLauncher" class="org.springframework.batch.core.launch.support.SimpleJobLauncher" p:jobRepository-ref="jobRepository"/>
-</beans>
-
View
43 samples/pig-scripting/src/main/resources/META-INF/spring/context.xml
@@ -1,43 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:context="http://www.springframework.org/schema/context"
- xmlns:hdp="http://www.springframework.org/schema/hadoop"
- xmlns:batch="http://www.springframework.org/schema/batch"
- xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
- http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
- http://www.springframework.org/schema/hadoop http://www.springframework.org/schema/hadoop/spring-hadoop.xsd
- http://www.springframework.org/schema/batch http://www.springframework.org/schema/batch/spring-batch.xsd">
-
-
- <import resource="batch-common.xml"/>
-
- <context:property-placeholder location="hadoop.properties"/>
-
- <hdp:configuration>
- fs.default.name=${hd.fs}
- </hdp:configuration>
-
- <hdp:pig configuration-ref="hadoopConfiguration" exec-type="MAPREDUCE"/>
-
- <job id="pigJob" xmlns="http://www.springframework.org/schema/batch">
- <step id="prepareData" next="loadData">
- <tasklet ref="prepareDataTasklet" />
- </step>
- <step id="loadData">
- <tasklet ref="loadDataTasklet" />
- </step>
- </job>
-
- <hdp:script-tasklet id="prepareDataTasklet">
- <hdp:script location="cp-data.js">
- <hdp:property name="inputPath" value="${input.path}" />
- <hdp:property name="outputPath" value="${output.path}" />
- <hdp:property name="localResource" value="${local.data}" />
- </hdp:script>
- </hdp:script-tasklet>
-
- <hdp:pig-tasklet id="loadDataTasklet">
- <hdp:script location="script.pig" />
- </hdp:pig-tasklet>
-</beans>
View
3  samples/pig-scripting/src/main/resources/core-site.xml
@@ -1,3 +0,0 @@
-<configuration>
-
-</configuration>
View
27 samples/pig-scripting/src/main/resources/cp-data.js
@@ -1,27 +0,0 @@
-//
-// Simple script that prepares the HDFS env for a Hadoop job:
-//
-// 1. deletes the input/output paths in HDFS (in case they exist)
-// 2. copies a local resource to HDFS
-//
-// required params are:
-// * inputPath
-// * outputPath
-// * localResource
-
-
-// 'hack' default permissions to make Hadoop work on Windows
-if (java.lang.System.getProperty("os.name").startsWith("Windows")) {
- // 0655 = -rwxr-xr-x
- org.apache.hadoop.mapreduce.JobSubmissionFiles.JOB_DIR_PERMISSION.fromShort(0655)
- org.apache.hadoop.mapreduce.JobSubmissionFiles.JOB_FILE_PERMISSION.fromShort(0655)
-}
-
-
-// delete job paths
-if (fsh.test(inputPath)) { fsh.rmr(inputPath) }
-if (fsh.test(outputPath)) { fsh.rmr(outputPath) }
-
-// copy local resource using the streams directly (to be portable across envs)
-inStream = cl.getResourceAsStream(localResource)
-org.apache.hadoop.io.IOUtils.copyBytes(inStream, fs.create(inputPath), cfg)
View
8 samples/pig-scripting/src/main/resources/hadoop.properties
@@ -1,8 +0,0 @@
-hd.fs=hdfs://localhost:9000
-mapred.job.tracker=localhost:9001
-input.path=u.data
-output.path=u.data
-local.data=ml-100k/u.data
-
-
-
View
22 samples/pig-scripting/src/main/resources/log4j.properties
@@ -1,22 +0,0 @@
-log4j.rootCategory=INFO, stdout
-
-log4j.appender.stdout=org.apache.log4j.ConsoleAppender
-log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
-log4j.appender.stdout.layout.ConversionPattern=%d %p [%c] - <%m>%n
-
-log4j.logger.org.springframework.batch=INFO
-
-log4j.appender.R=org.apache.log4j.RollingFileAppender
-log4j.appender.R.File=example.log
-
-log4j.appender.R.MaxFileSize=100KB
-# Keep one backup file
-log4j.appender.R.MaxBackupIndex=1
-
-log4j.appender.R.layout=org.apache.log4j.PatternLayout
-log4j.appender.R.layout.ConversionPattern=%p %t %c - %m%n
-
-
-
-# for debugging datasource initialization
-# log4j.category.test.jdbc=DEBUG
View
6 samples/pig-scripting/src/main/resources/script.pig
@@ -1,6 +0,0 @@
-a = LOAD 'u.data' as (userid:int, movieid:int, rating:int, unixtime:chararray);
-top_rating = FILTER a by rating > 4;
-user_rating = GROUP top_rating BY movieid;
-top_three = LIMIT user_rating 3;
-DUMP top_three;
-
View
39 samples/readme.txt
@@ -1,39 +0,0 @@
-Spring Hadoop Samples
----------------------
-
-This folder contains various various demo applications and samples for Spring Hadoop.
-
-Please see each folder for detailed instructions (readme.txt).
-
-As a general rule, each demo provides an integration tests that bootstraps
-Hadoop, installs the demo and its dependencies and interacts with the application.
-Shared data sets and project settings (such as the dependencies versions) reside in
-the parent folder but are copied by each project at build time.
-
-SAMPLES OVERVIEW
-----------------
-
-* wordcount
-The 'traditional' Hadoop example - a word count MapReduce app configured with Spring Hadoop
-
-* batch-wordcount
-The same word count application featuring Spring Batch
-
-* hbase-crud
-Basic CRUD application interacting with HBase showcasing the support in Spring Hadoop
-
-
-BUILDING AND DEPLOYMENT
------------------------
-
-All demos require JDK 1.6+.
-
-Each module can be run from its top folder using gradle wrapper:
-
-*nix/BSD
-# ../gradlew
-
-or
-
-Widows
-# ..\gradlew
View
836 samples/resources/data/nietzsche-chapter-1.txt
@@ -1,836 +0,0 @@
-The Project Gutenberg EBook of Beyond Good and Evil, by Friedrich Nietzsche
-
-This eBook is for the use of anyone anywhere at no cost and with
-almost no restrictions whatsoever. You may copy it, give it away or
-re-use it under the terms of the Project Gutenberg License included
-with this eBook or online at www.gutenberg.org
-
-
-Title: Beyond Good and Evil
-
-Author: Friedrich Nietzsche
-
-Translator: Helen Zimmern
-
-Release Date: August, 2003 [Etext #4363]
-Posting Date: December 7, 2009
-
-Language: English
-
-
-*** START OF THIS PROJECT GUTENBERG EBOOK BEYOND GOOD AND EVIL ***
-
-
-
-
-Produced by John Mamoun, Charles Franks and the Online
-Distributed Proofreading Team
-
-
-
-
-
-
-BEYOND GOOD AND EVIL
-
-By Friedrich Nietzsche
-
-
-Translated by Helen Zimmern
-
-
-
-TRANSCRIBER'S NOTE ABOUT THIS E-TEXT EDITION:
-
-The following is a reprint of the Helen Zimmern translation from German
-into English of "Beyond Good and Evil," as published in The Complete
-Works of Friedrich Nietzsche (1909-1913). Some adaptations from the
-original text were made to format it into an e-text. Italics in the
-original book are capitalized in this e-text, except for most foreign
-language phrases that were italicized. Original footnotes are put in
-brackets "[]" at the points where they are cited in the text. Some
-spellings were altered. "To-day" and "To-morrow" are spelled "today"
-and "tomorrow." Some words containing the letters "ise" in the original
-text, such as "idealise," had these letters changed to "ize," such as
-"idealize." "Sceptic" was changed to "skeptic."
-
-
-TABLE OF CONTENTS
-
- PREFACE
- BEYOND GOOD AND EVIL
-
- CHAPTER I: PREJUDICES OF PHILOSOPHERS
- CHAPTER II: THE FREE SPIRIT
- CHAPTER III: THE RELIGIOUS MOOD
- CHAPTER IV: APOPHTHEGMS AND INTERLUDES
- CHAPTER V: THE NATURAL HISTORY OF MORALS
- CHAPTER VI: WE SCHOLARS
- CHAPTER VII: OUR VIRTUES
- CHAPTER VIII: PEOPLES AND COUNTRIES
- CHAPTER IX: WHAT IS NOBLE?
-
- FROM THE HEIGHTS (POEM TRANSLATED BY L.A. MAGNUS)
-
-
-
-
-PREFACE
-
-
-SUPPOSING that Truth is a woman--what then? Is there not ground
-for suspecting that all philosophers, in so far as they have been
-dogmatists, have failed to understand women--that the terrible
-seriousness and clumsy importunity with which they have usually paid
-their addresses to Truth, have been unskilled and unseemly methods for
-winning a woman? Certainly she has never allowed herself to be won; and
-at present every kind of dogma stands with sad and discouraged mien--IF,
-indeed, it stands at all! For there are scoffers who maintain that it
-has fallen, that all dogma lies on the ground--nay more, that it is at
-its last gasp. But to speak seriously, there are good grounds for hoping
-that all dogmatizing in philosophy, whatever solemn, whatever conclusive
-and decided airs it has assumed, may have been only a noble puerilism
-and tyronism; and probably the time is at hand when it will be once
-and again understood WHAT has actually sufficed for the basis of such
-imposing and absolute philosophical edifices as the dogmatists have
-hitherto reared: perhaps some popular superstition of immemorial time
-(such as the soul-superstition, which, in the form of subject- and
-ego-superstition, has not yet ceased doing mischief): perhaps some
-play upon words, a deception on the part of grammar, or an
-audacious generalization of very restricted, very personal, very
-human--all-too-human facts. The philosophy of the dogmatists, it is to
-be hoped, was only a promise for thousands of years afterwards, as was
-astrology in still earlier times, in the service of which probably more
-labour, gold, acuteness, and patience have been spent than on any
-actual science hitherto: we owe to it, and to its "super-terrestrial"
-pretensions in Asia and Egypt, the grand style of architecture. It seems
-that in order to inscribe themselves upon the heart of humanity with
-everlasting claims, all great things have first to wander about the
-earth as enormous and awe-inspiring caricatures: dogmatic philosophy has
-been a caricature of this kind--for instance, the Vedanta doctrine in
-Asia, and Platonism in Europe. Let us not be ungrateful to it, although
-it must certainly be confessed that the worst, the most tiresome,
-and the most dangerous of errors hitherto has been a dogmatist
-error--namely, Plato's invention of Pure Spirit and the Good in Itself.
-But now when it has been surmounted, when Europe, rid of this nightmare,
-can again draw breath freely and at least enjoy a healthier--sleep,
-we, WHOSE DUTY IS WAKEFULNESS ITSELF, are the heirs of all the strength
-which the struggle against this error has fostered. It amounted to
-the very inversion of truth, and the denial of the PERSPECTIVE--the
-fundamental condition--of life, to speak of Spirit and the Good as Plato
-spoke of them; indeed one might ask, as a physician: "How did such a
-malady attack that finest product of antiquity, Plato? Had the wicked
-Socrates really corrupted him? Was Socrates after all a corrupter of
-youths, and deserved his hemlock?" But the struggle against Plato,
-or--to speak plainer, and for the "people"--the struggle against
-the ecclesiastical oppression of millenniums of Christianity (FOR
-CHRISTIANITY IS PLATONISM FOR THE "PEOPLE"), produced in Europe
-a magnificent tension of soul, such as had not existed anywhere
-previously; with such a tensely strained bow one can now aim at the
-furthest goals. As a matter of fact, the European feels this tension as
-a state of distress, and twice attempts have been made in grand style to
-unbend the bow: once by means of Jesuitism, and the second time by means
-of democratic enlightenment--which, with the aid of liberty of the press
-and newspaper-reading, might, in fact, bring it about that the spirit
-would not so easily find itself in "distress"! (The Germans invented
-gunpowder--all credit to them! but they again made things square--they
-invented printing.) But we, who are neither Jesuits, nor democrats,
-nor even sufficiently Germans, we GOOD EUROPEANS, and free, VERY free
-spirits--we have it still, all the distress of spirit and all the
-tension of its bow! And perhaps also the arrow, the duty, and, who
-knows? THE GOAL TO AIM AT....
-
-Sils Maria Upper Engadine, JUNE, 1885.
-
-
-
-
-CHAPTER I. PREJUDICES OF PHILOSOPHERS
-
-
-1. The Will to Truth, which is to tempt us to many a hazardous
-enterprise, the famous Truthfulness of which all philosophers have
-hitherto spoken with respect, what questions has this Will to Truth not
-laid before us! What strange, perplexing, questionable questions! It is
-already a long story; yet it seems as if it were hardly commenced. Is
-it any wonder if we at last grow distrustful, lose patience, and turn
-impatiently away? That this Sphinx teaches us at last to ask questions
-ourselves? WHO is it really that puts questions to us here? WHAT really
-is this "Will to Truth" in us? In fact we made a long halt at the
-question as to the origin of this Will--until at last we came to an
-absolute standstill before a yet more fundamental question. We inquired
-about the VALUE of this Will. Granted that we want the truth: WHY NOT
-RATHER untruth? And uncertainty? Even ignorance? The problem of the
-value of truth presented itself before us--or was it we who presented
-ourselves before the problem? Which of us is the Oedipus here? Which
-the Sphinx? It would seem to be a rendezvous of questions and notes of
-interrogation. And could it be believed that it at last seems to us as
-if the problem had never been propounded before, as if we were the first
-to discern it, get a sight of it, and RISK RAISING it? For there is risk
-in raising it, perhaps there is no greater risk.
-
-2. "HOW COULD anything originate out of its opposite? For example, truth
-out of error? or the Will to Truth out of the will to deception? or the
-generous deed out of selfishness? or the pure sun-bright vision of the
-wise man out of covetousness? Such genesis is impossible; whoever dreams
-of it is a fool, nay, worse than a fool; things of the highest
-value must have a different origin, an origin of THEIR own--in this
-transitory, seductive, illusory, paltry world, in this turmoil of
-delusion and cupidity, they cannot have their source. But rather in
-the lap of Being, in the intransitory, in the concealed God, in the
-'Thing-in-itself--THERE must be their source, and nowhere else!"--This
-mode of reasoning discloses the typical prejudice by which
-metaphysicians of all times can be recognized, this mode of valuation
-is at the back of all their logical procedure; through this "belief" of
-theirs, they exert themselves for their "knowledge," for something that
-is in the end solemnly christened "the Truth." The fundamental belief of
-metaphysicians is THE BELIEF IN ANTITHESES OF VALUES. It never occurred
-even to the wariest of them to doubt here on the very threshold (where
-doubt, however, was most necessary); though they had made a solemn
-vow, "DE OMNIBUS DUBITANDUM." For it may be doubted, firstly, whether
-antitheses exist at all; and secondly, whether the popular valuations
-and antitheses of value upon which metaphysicians have set their
-seal, are not perhaps merely superficial estimates, merely provisional
-perspectives, besides being probably made from some corner, perhaps from
-below--"frog perspectives," as it were, to borrow an expression current
-among painters. In spite of all the value which may belong to the true,
-the positive, and the unselfish, it might be possible that a higher
-and more fundamental value for life generally should be assigned to
-pretence, to the will to delusion, to selfishness, and cupidity. It
-might even be possible that WHAT constitutes the value of those good and
-respected things, consists precisely in their being insidiously
-related, knotted, and crocheted to these evil and apparently opposed
-things--perhaps even in being essentially identical with them. Perhaps!
-But who wishes to concern himself with such dangerous "Perhapses"!
-For that investigation one must await the advent of a new order of
-philosophers, such as will have other tastes and inclinations, the
-reverse of those hitherto prevalent--philosophers of the dangerous
-"Perhaps" in every sense of the term. And to speak in all seriousness, I
-see such new philosophers beginning to appear.
-
-3. Having kept a sharp eye on philosophers, and having read between
-their lines long enough, I now say to myself that the greater part of
-conscious thinking must be counted among the instinctive functions, and
-it is so even in the case of philosophical thinking; one has here to
-learn anew, as one learned anew about heredity and "innateness." As
-little as the act of birth comes into consideration in the whole process
-and procedure of heredity, just as little is "being-conscious" OPPOSED
-to the instinctive in any decisive sense; the greater part of the
-conscious thinking of a philosopher is secretly influenced by his
-instincts, and forced into definite channels. And behind all logic and
-its seeming sovereignty of movement, there are valuations, or to speak
-more plainly, physiological demands, for the maintenance of a definite
-mode of life For example, that the certain is worth more than the
-uncertain, that illusion is less valuable than "truth" such valuations,
-in spite of their regulative importance for US, might notwithstanding be
-only superficial valuations, special kinds of _niaiserie_, such as may
-be necessary for the maintenance of beings such as ourselves. Supposing,
-in effect, that man is not just the "measure of things."
-
-4. The falseness of an opinion is not for us any objection to it: it is
-here, perhaps, that our new language sounds most strangely. The
-question is, how far an opinion is life-furthering, life-preserving,
-species-preserving, perhaps species-rearing, and we are fundamentally
-inclined to maintain that the falsest opinions (to which the synthetic
-judgments a priori belong), are the most indispensable to us, that
-without a recognition of logical fictions, without a comparison of
-reality with the purely IMAGINED world of the absolute and immutable,
-without a constant counterfeiting of the world by means of numbers,
-man could not live--that the renunciation of false opinions would be
-a renunciation of life, a negation of life. TO RECOGNISE UNTRUTH AS A
-CONDITION OF LIFE; that is certainly to impugn the traditional ideas of
-value in a dangerous manner, and a philosophy which ventures to do so,
-has thereby alone placed itself beyond good and evil.
-
-5. That which causes philosophers to be regarded half-distrustfully
-and half-mockingly, is not the oft-repeated discovery how innocent they
-are--how often and easily they make mistakes and lose their way, in
-short, how childish and childlike they are,--but that there is not
-enough honest dealing with them, whereas they all raise a loud and
-virtuous outcry when the problem of truthfulness is even hinted at in
-the remotest manner. They all pose as though their real opinions had
-been discovered and attained through the self-evolving of a cold, pure,
-divinely indifferent dialectic (in contrast to all sorts of mystics,
-who, fairer and foolisher, talk of "inspiration"), whereas, in fact, a
-prejudiced proposition, idea, or "suggestion," which is generally
-their heart's desire abstracted and refined, is defended by them with
-arguments sought out after the event. They are all advocates who do not
-wish to be regarded as such, generally astute defenders, also, of their
-prejudices, which they dub "truths,"--and VERY far from having the
-conscience which bravely admits this to itself, very far from having
-the good taste of the courage which goes so far as to let this be
-understood, perhaps to warn friend or foe, or in cheerful confidence
-and self-ridicule. The spectacle of the Tartuffery of old Kant, equally
-stiff and decent, with which he entices us into the dialectic
-by-ways that lead (more correctly mislead) to his "categorical
-imperative"--makes us fastidious ones smile, we who find no small
-amusement in spying out the subtle tricks of old moralists and ethical
-preachers. Or, still more so, the hocus-pocus in mathematical form, by
-means of which Spinoza has, as it were, clad his philosophy in mail and
-mask--in fact, the "love of HIS wisdom," to translate the term fairly
-and squarely--in order thereby to strike terror at once into the heart
-of the assailant who should dare to cast a glance on that invincible
-maiden, that Pallas Athene:--how much of personal timidity and
-vulnerability does this masquerade of a sickly recluse betray!
-
-6. It has gradually become clear to me what every great philosophy up
-till now has consisted of--namely, the confession of its originator, and
-a species of involuntary and unconscious auto-biography; and moreover
-that the moral (or immoral) purpose in every philosophy has constituted
-the true vital germ out of which the entire plant has always grown.
-Indeed, to understand how the abstrusest metaphysical assertions of a
-philosopher have been arrived at, it is always well (and wise) to first
-ask oneself: "What morality do they (or does he) aim at?" Accordingly,
-I do not believe that an "impulse to knowledge" is the father of
-philosophy; but that another impulse, here as elsewhere, has only made
-use of knowledge (and mistaken knowledge!) as an instrument. But whoever
-considers the fundamental impulses of man with a view to determining
-how far they may have here acted as INSPIRING GENII (or as demons and
-cobolds), will find that they have all practiced philosophy at one time
-or another, and that each one of them would have been only too glad to
-look upon itself as the ultimate end of existence and the legitimate
-LORD over all the other impulses. For every impulse is imperious, and as
-SUCH, attempts to philosophize. To be sure, in the case of scholars, in
-the case of really scientific men, it may be otherwise--"better," if
-you will; there there may really be such a thing as an "impulse to
-knowledge," some kind of small, independent clock-work, which, when well
-wound up, works away industriously to that end, WITHOUT the rest of
-the scholarly impulses taking any material part therein. The actual
-"interests" of the scholar, therefore, are generally in quite another
-direction--in the family, perhaps, or in money-making, or in politics;
-it is, in fact, almost indifferent at what point of research his little
-machine is placed, and whether the hopeful young worker becomes a
-good philologist, a mushroom specialist, or a chemist; he is not
-CHARACTERISED by becoming this or that. In the philosopher, on the
-contrary, there is absolutely nothing impersonal; and above all,
-his morality furnishes a decided and decisive testimony as to WHO HE
-IS,--that is to say, in what order the deepest impulses of his nature
-stand to each other.
-
-7. How malicious philosophers can be! I know of nothing more stinging
-than the joke Epicurus took the liberty of making on Plato and the
-Platonists; he called them Dionysiokolakes. In its original sense,
-and on the face of it, the word signifies "Flatterers of
-Dionysius"--consequently, tyrants' accessories and lick-spittles;
-besides this, however, it is as much as to say, "They are all ACTORS,
-there is nothing genuine about them" (for Dionysiokolax was a popular
-name for an actor). And the latter is really the malignant reproach that
-Epicurus cast upon Plato: he was annoyed by the grandiose manner, the
-mise en scene style of which Plato and his scholars were masters--of
-which Epicurus was not a master! He, the old school-teacher of Samos,
-who sat concealed in his little garden at Athens, and wrote three
-hundred books, perhaps out of rage and ambitious envy of Plato, who
-knows! Greece took a hundred years to find out who the garden-god
-Epicurus really was. Did she ever find out?
-
-8. There is a point in every philosophy at which the "conviction" of
-the philosopher appears on the scene; or, to put it in the words of an
-ancient mystery:
-
-Adventavit asinus, Pulcher et fortissimus.
-
-9. You desire to LIVE "according to Nature"? Oh, you noble Stoics, what
-fraud of words! Imagine to yourselves a being like Nature, boundlessly
-extravagant, boundlessly indifferent, without purpose or consideration,
-without pity or justice, at once fruitful and barren and uncertain:
-imagine to yourselves INDIFFERENCE as a power--how COULD you live
-in accordance with such indifference? To live--is not that just
-endeavouring to be otherwise than this Nature? Is not living valuing,
-preferring, being unjust, being limited, endeavouring to be different?
-And granted that your imperative, "living according to Nature," means
-actually the same as "living according to life"--how could you do
-DIFFERENTLY? Why should you make a principle out of what you yourselves
-are, and must be? In reality, however, it is quite otherwise with you:
-while you pretend to read with rapture the canon of your law in Nature,
-you want something quite the contrary, you extraordinary stage-players
-and self-deluders! In your pride you wish to dictate your morals and
-ideals to Nature, to Nature herself, and to incorporate them therein;
-you insist that it shall be Nature "according to the Stoa," and would
-like everything to be made after your own image, as a vast, eternal
-glorification and generalism of Stoicism! With all your love for truth,
-you have forced yourselves so long, so persistently, and with such
-hypnotic rigidity to see Nature FALSELY, that is to say, Stoically,
-that you are no longer able to see it otherwise--and to crown all, some
-unfathomable superciliousness gives you the Bedlamite hope that
-BECAUSE you are able to tyrannize over yourselves--Stoicism is
-self-tyranny--Nature will also allow herself to be tyrannized over: is
-not the Stoic a PART of Nature?... But this is an old and everlasting
-story: what happened in old times with the Stoics still happens today,
-as soon as ever a philosophy begins to believe in itself. It always
-creates the world in its own image; it cannot do otherwise; philosophy
-is this tyrannical impulse itself, the most spiritual Will to Power, the
-will to "creation of the world," the will to the causa prima.
-
-10. The eagerness and subtlety, I should even say craftiness, with
-which the problem of "the real and the apparent world" is dealt with at
-present throughout Europe, furnishes food for thought and attention; and
-he who hears only a "Will to Truth" in the background, and nothing else,
-cannot certainly boast of the sharpest ears. In rare and isolated
-cases, it may really have happened that such a Will to Truth--a certain
-extravagant and adventurous pluck, a metaphysician's ambition of the
-forlorn hope--has participated therein: that which in the end always
-prefers a handful of "certainty" to a whole cartload of beautiful
-possibilities; there may even be puritanical fanatics of conscience,
-who prefer to put their last trust in a sure nothing, rather than in an
-uncertain something. But that is Nihilism, and the sign of a despairing,
-mortally wearied soul, notwithstanding the courageous bearing such a
-virtue may display. It seems, however, to be otherwise with stronger
-and livelier thinkers who are still eager for life. In that they side
-AGAINST appearance, and speak superciliously of "perspective," in
-that they rank the credibility of their own bodies about as low as the
-credibility of the ocular evidence that "the earth stands still," and
-thus, apparently, allowing with complacency their securest possession
-to escape (for what does one at present believe in more firmly than
-in one's body?),--who knows if they are not really trying to win back
-something which was formerly an even securer possession, something
-of the old domain of the faith of former times, perhaps the "immortal
-soul," perhaps "the old God," in short, ideas by which they could live
-better, that is to say, more vigorously and more joyously, than by
-"modern ideas"? There is DISTRUST of these modern ideas in this mode
-of looking at things, a disbelief in all that has been constructed
-yesterday and today; there is perhaps some slight admixture of satiety
-and scorn, which can no longer endure the BRIC-A-BRAC of ideas of the
-most varied origin, such as so-called Positivism at present throws on
-the market; a disgust of the more refined taste at the village-fair
-motleyness and patchiness of all these reality-philosophasters, in whom
-there is nothing either new or true, except this motleyness. Therein it
-seems to me that we should agree with those skeptical anti-realists and
-knowledge-microscopists of the present day; their instinct, which repels
-them from MODERN reality, is unrefuted... what do their retrograde
-by-paths concern us! The main thing about them is NOT that they wish
-to go "back," but that they wish to get AWAY therefrom. A little MORE
-strength, swing, courage, and artistic power, and they would be OFF--and
-not back!
-
-11. It seems to me that there is everywhere an attempt at present to
-divert attention from the actual influence which Kant exercised on
-German philosophy, and especially to ignore prudently the value which
-he set upon himself. Kant was first and foremost proud of his Table of
-Categories; with it in his hand he said: "This is the most difficult
-thing that could ever be undertaken on behalf of metaphysics." Let us
-only understand this "could be"! He was proud of having DISCOVERED a
-new faculty in man, the faculty of synthetic judgment a priori. Granting
-that he deceived himself in this matter; the development and rapid
-flourishing of German philosophy depended nevertheless on his pride, and
-on the eager rivalry of the younger generation to discover if possible
-something--at all events "new faculties"--of which to be still
-prouder!--But let us reflect for a moment--it is high time to do so.
-"How are synthetic judgments a priori POSSIBLE?" Kant asks himself--and
-what is really his answer? "BY MEANS OF A MEANS (faculty)"--but
-unfortunately not in five words, but so circumstantially, imposingly,
-and with such display of German profundity and verbal flourishes, that
-one altogether loses sight of the comical niaiserie allemande involved
-in such an answer. People were beside themselves with delight over this
-new faculty, and the jubilation reached its climax when Kant further
-discovered a moral faculty in man--for at that time Germans were still
-moral, not yet dabbling in the "Politics of hard fact." Then came
-the honeymoon of German philosophy. All the young theologians of the
-Tubingen institution went immediately into the groves--all seeking for
-"faculties." And what did they not find--in that innocent, rich, and
-still youthful period of the German spirit, to which Romanticism, the
-malicious fairy, piped and sang, when one could not yet distinguish
-between "finding" and "inventing"! Above all a faculty for the
-"transcendental"; Schelling christened it, intellectual intuition,
-and thereby gratified the most earnest longings of the naturally
-pious-inclined Germans. One can do no greater wrong to the whole of
-this exuberant and eccentric movement (which was really youthfulness,
-notwithstanding that it disguised itself so boldly, in hoary and senile
-conceptions), than to take it seriously, or even treat it with moral
-indignation. Enough, however--the world grew older, and the dream
-vanished. A time came when people rubbed their foreheads, and they still
-rub them today. People had been dreaming, and first and foremost--old
-Kant. "By means of a means (faculty)"--he had said, or at least meant to
-say. But, is that--an answer? An explanation? Or is it not rather merely
-a repetition of the question? How does opium induce sleep? "By means of
-a means (faculty)," namely the virtus dormitiva, replies the doctor in
-Moliere,
-
- Quia est in eo virtus dormitiva,
- Cujus est natura sensus assoupire.
-
-But such replies belong to the realm of comedy, and it is high time
-to replace the Kantian question, "How are synthetic judgments a PRIORI
-possible?" by another question, "Why is belief in such judgments
-necessary?"--in effect, it is high time that we should understand
-that such judgments must be believed to be true, for the sake of the
-preservation of creatures like ourselves; though they still might
-naturally be false judgments! Or, more plainly spoken, and roughly and
-readily--synthetic judgments a priori should not "be possible" at all;
-we have no right to them; in our mouths they are nothing but false
-judgments. Only, of course, the belief in their truth is necessary, as
-plausible belief and ocular evidence belonging to the perspective view
-of life. And finally, to call to mind the enormous influence which
-"German philosophy"--I hope you understand its right to inverted commas
-(goosefeet)?--has exercised throughout the whole of Europe, there is
-no doubt that a certain VIRTUS DORMITIVA had a share in it; thanks to
-German philosophy, it was a delight to the noble idlers, the virtuous,
-the mystics, the artiste, the three-fourths Christians, and the
-political obscurantists of all nations, to find an antidote to the still
-overwhelming sensualism which overflowed from the last century into
-this, in short--"sensus assoupire."...
-
-12. As regards materialistic atomism, it is one of the best-refuted
-theories that have been advanced, and in Europe there is now perhaps
-no one in the learned world so unscholarly as to attach serious
-signification to it, except for convenient everyday use (as an
-abbreviation of the means of expression)--thanks chiefly to the Pole
-Boscovich: he and the Pole Copernicus have hitherto been the greatest
-and most successful opponents of ocular evidence. For while Copernicus
-has persuaded us to believe, contrary to all the senses, that the earth
-does NOT stand fast, Boscovich has taught us to abjure the belief in the
-last thing that "stood fast" of the earth--the belief in "substance," in
-"matter," in the earth-residuum, and particle-atom: it is the greatest
-triumph over the senses that has hitherto been gained on earth. One
-must, however, go still further, and also declare war, relentless war
-to the knife, against the "atomistic requirements" which still lead a
-dangerous after-life in places where no one suspects them, like the more
-celebrated "metaphysical requirements": one must also above all give
-the finishing stroke to that other and more portentous atomism which
-Christianity has taught best and longest, the SOUL-ATOMISM. Let it be
-permitted to designate by this expression the belief which regards the
-soul as something indestructible, eternal, indivisible, as a monad,
-as an atomon: this belief ought to be expelled from science! Between
-ourselves, it is not at all necessary to get rid of "the soul" thereby,
-and thus renounce one of the oldest and most venerated hypotheses--as
-happens frequently to the clumsiness of naturalists, who can hardly
-touch on the soul without immediately losing it. But the way is open
-for new acceptations and refinements of the soul-hypothesis; and such
-conceptions as "mortal soul," and "soul of subjective multiplicity,"
-and "soul as social structure of the instincts and passions," want
-henceforth to have legitimate rights in science. In that the NEW
-psychologist is about to put an end to the superstitions which have
-hitherto flourished with almost tropical luxuriance around the idea of
-the soul, he is really, as it were, thrusting himself into a new desert
-and a new distrust--it is possible that the older psychologists had a
-merrier and more comfortable time of it; eventually, however, he finds
-that precisely thereby he is also condemned to INVENT--and, who knows?
-perhaps to DISCOVER the new.
-
-13. Psychologists should bethink themselves before putting down the
-instinct of self-preservation as the cardinal instinct of an organic
-being. A living thing seeks above all to DISCHARGE its strength--life
-itself is WILL TO POWER; self-preservation is only one of the indirect
-and most frequent RESULTS thereof. In short, here, as everywhere else,
-let us beware of SUPERFLUOUS teleological principles!--one of which
-is the instinct of self-preservation (we owe it to Spinoza's
-inconsistency). It is thus, in effect, that method ordains, which must
-be essentially economy of principles.
-
-14. It is perhaps just dawning on five or six minds that natural
-philosophy is only a world-exposition and world-arrangement (according
-to us, if I may say so!) and NOT a world-explanation; but in so far as
-it is based on belief in the senses, it is regarded as more, and for a
-long time to come must be regarded as more--namely, as an explanation.
-It has eyes and fingers of its own, it has ocular evidence and
-palpableness of its own: this operates fascinatingly, persuasively, and
-CONVINCINGLY upon an age with fundamentally plebeian tastes--in fact, it
-follows instinctively the canon of truth of eternal popular sensualism.
-What is clear, what is "explained"? Only that which can be seen and
-felt--one must pursue every problem thus far. Obversely, however, the
-charm of the Platonic mode of thought, which was an ARISTOCRATIC mode,
-consisted precisely in RESISTANCE to obvious sense-evidence--perhaps
-among men who enjoyed even stronger and more fastidious senses than our
-contemporaries, but who knew how to find a higher triumph in remaining
-masters of them: and this by means of pale, cold, grey conceptional
-networks which they threw over the motley whirl of the senses--the
-mob of the senses, as Plato said. In this overcoming of the world, and
-interpreting of the world in the manner of Plato, there was an ENJOYMENT
-different from that which the physicists of today offer us--and likewise
-the Darwinists and anti-teleologists among the physiological workers,
-with their principle of the "smallest possible effort," and the greatest
-possible blunder. "Where there is nothing more to see or to grasp, there
-is also nothing more for men to do"--that is certainly an imperative
-different from the Platonic one, but it may notwithstanding be the right
-imperative for a hardy, laborious race of machinists and bridge-builders
-of the future, who have nothing but ROUGH work to perform.
-
-15. To study physiology with a clear conscience, one must insist on
-the fact that the sense-organs are not phenomena in the sense of the
-idealistic philosophy; as such they certainly could not be causes!
-Sensualism, therefore, at least as regulative hypothesis, if not as
-heuristic principle. What? And others say even that the external world
-is the work of our organs? But then our body, as a part of this external
-world, would be the work of our organs! But then our organs themselves
-would be the work of our organs! It seems to me that this is a
-complete REDUCTIO AD ABSURDUM, if the conception CAUSA SUI is something
-fundamentally absurd. Consequently, the external world is NOT the work
-of our organs--?
-
-16. There are still harmless self-observers who believe that there are
-"immediate certainties"; for instance, "I think," or as the superstition
-of Schopenhauer puts it, "I will"; as though cognition here got hold
-of its object purely and simply as "the thing in itself," without any
-falsification taking place either on the part of the subject or the
-object. I would repeat it, however, a hundred times, that "immediate
-certainty," as well as "absolute knowledge" and the "thing in itself,"
-involve a CONTRADICTIO IN ADJECTO; we really ought to free ourselves
-from the misleading significance of words! The people on their part may
-think that cognition is knowing all about things, but the philosopher
-must say to himself: "When I analyze the process that is expressed in
-the sentence, 'I think,' I find a whole series of daring assertions, the
-argumentative proof of which would be difficult, perhaps impossible:
-for instance, that it is _I_ who think, that there must necessarily be
-something that thinks, that thinking is an activity and operation on the
-part of a being who is thought of as a cause, that there is an 'ego,'
-and finally, that it is already determined what is to be designated by
-thinking--that I KNOW what thinking is. For if I had not already decided
-within myself what it is, by what standard could I determine whether
-that which is just happening is not perhaps 'willing' or 'feeling'? In
-short, the assertion 'I think,' assumes that I COMPARE my state at the
-present moment with other states of myself which I know, in order to
-determine what it is; on account of this retrospective connection with
-further 'knowledge,' it has, at any rate, no immediate certainty for
-me."--In place of the "immediate certainty" in which the people may
-believe in the special case, the philosopher thus finds a series of
-metaphysical questions presented to him, veritable conscience questions
-of the intellect, to wit: "Whence did I get the notion of 'thinking'?
-Why do I believe in cause and effect? What gives me the right to speak
-of an 'ego,' and even of an 'ego' as cause, and finally of an 'ego'
-as cause of thought?" He who ventures to answer these metaphysical
-questions at once by an appeal to a sort of INTUITIVE perception, like
-the person who says, "I think, and know that this, at least, is
-true, actual, and certain"--will encounter a smile and two notes of
-interrogation in a philosopher nowadays. "Sir," the philosopher will
-perhaps give him to understand, "it is improbable that you are not
-mistaken, but why should it be the truth?"
-
-17. With regard to the superstitions of logicians, I shall never tire
-of emphasizing a small, terse fact, which is unwillingly recognized by
-these credulous minds--namely, that a thought comes when "it" wishes,
-and not when "I" wish; so that it is a PERVERSION of the facts of the
-case to say that the subject "I" is the condition of the predicate
-"think." ONE thinks; but that this "one" is precisely the famous old
-"ego," is, to put it mildly, only a supposition, an assertion, and
-assuredly not an "immediate certainty." After all, one has even gone too
-far with this "one thinks"--even the "one" contains an INTERPRETATION of
-the process, and does not belong to the process itself. One infers here
-according to the usual grammatical formula--"To think is an activity;
-every activity requires an agency that is active; consequently"... It
-was pretty much on the same lines that the older atomism sought, besides
-the operating "power," the material particle wherein it resides and out
-of which it operates--the atom. More rigorous minds, however, learnt at
-last to get along without this "earth-residuum," and perhaps some day we
-shall accustom ourselves, even from the logician's point of view, to
-get along without the little "one" (to which the worthy old "ego" has
-refined itself).
-
-18. It is certainly not the least charm of a theory that it is
-refutable; it is precisely thereby that it attracts the more subtle
-minds. It seems that the hundred-times-refuted theory of the "free will"
-owes its persistence to this charm alone; some one is always appearing
-who feels himself strong enough to refute it.
-
-19. Philosophers are accustomed to speak of the will as though it were
-the best-known thing in the world; indeed, Schopenhauer has given us
-to understand that the will alone is really known to us, absolutely and
-completely known, without deduction or addition. But it again and
-again seems to me that in this case Schopenhauer also only did what
-philosophers are in the habit of doing--he seems to have adopted a
-POPULAR PREJUDICE and exaggerated it. Willing seems to me to be above
-all something COMPLICATED, something that is a unity only in name--and
-it is precisely in a name that popular prejudice lurks, which has got
-the mastery over the inadequate precautions of philosophers in all ages.
-So let us for once be more cautious, let us be "unphilosophical": let
-us say that in all willing there is firstly a plurality of sensations,
-namely, the sensation of the condition "AWAY FROM WHICH we go," the
-sensation of the condition "TOWARDS WHICH we go," the sensation of this
-"FROM" and "TOWARDS" itself, and then besides, an accompanying muscular
-sensation, which, even without our putting in motion "arms and legs,"
-commences its action by force of habit, directly we "will" anything.
-Therefore, just as sensations (and indeed many kinds of sensations) are
-to be recognized as ingredients of the will, so, in the second place,
-thinking is also to be recognized; in every act of the will there is
-a ruling thought;--and let us not imagine it possible to sever this
-thought from the "willing," as if the will would then remain over!
-In the third place, the will is not only a complex of sensation and
-thinking, but it is above all an EMOTION, and in fact the emotion of the
-command. That which is termed "freedom of the will" is essentially the
-emotion of supremacy in respect to him who must obey: "I am free, 'he'
-must obey"--this consciousness is inherent in every will; and equally
-so the straining of the attention, the straight look which fixes itself
-exclusively on one thing, the unconditional judgment that "this and
-nothing else is necessary now," the inward certainty that obedience
-will be rendered--and whatever else pertains to the position of the
-commander. A man who WILLS commands something within himself which
-renders obedience, or which he believes renders obedience. But now let
-us notice what is the strangest thing about the will,--this affair so
-extremely complex, for which the people have only one name. Inasmuch as
-in the given circumstances we are at the same time the commanding AND
-the obeying parties, and as the obeying party we know the sensations of
-constraint, impulsion, pressure, resistance, and motion, which usually
-commence immediately after the act of will; inasmuch as, on the other
-hand, we are accustomed to disregard this duality, and to deceive
-ourselves about it by means of the synthetic term "I": a whole series
-of erroneous conclusions, and consequently of false judgments about the
-will itself, has become attached to the act of willing--to such a degree
-that he who wills believes firmly that willing SUFFICES for action.
-Since in the majority of cases there has only been exercise of will
-when the effect of the command--consequently obedience, and therefore
-action--was to be EXPECTED, the APPEARANCE has translated itself into
-the sentiment, as if there were a NECESSITY OF EFFECT; in a word, he who
-wills believes with a fair amount of certainty that will and action are
-somehow one; he ascribes the success, the carrying out of the willing,
-to the will itself, and thereby enjoys an increase of the sensation
-of power which accompanies all success. "Freedom of Will"--that is the
-expression for the complex state of delight of the person exercising
-volition, who commands and at the same time identifies himself with
-the executor of the order--who, as such, enjoys also the triumph over
-obstacles, but thinks within himself that it was really his own will
-that overcame them. In this way the person exercising volition adds the
-feelings of delight of his successful executive instruments, the useful
-"underwills" or under-souls--indeed, our body is but a social structure
-composed of many souls--to his feelings of delight as commander. L'EFFET
-C'EST MOI. what happens here is what happens in every well-constructed
-and happy commonwealth, namely, that the governing class identifies
-itself with the successes of the commonwealth. In all willing it is
-absolutely a question of commanding and obeying, on the basis, as
-already said, of a social structure composed of many "souls", on which
-account a philosopher should claim the right to include willing-as-such
-within the sphere of morals--regarded as the doctrine of the relations
-of supremacy under which the phenomenon of "life" manifests itself.
-
-20. That the separate philosophical ideas are not anything optional or
-autonomously evolving, but grow up in connection and relationship with
-each other, that, however suddenly and arbitrarily they seem to appear
-in the history of thought, they nevertheless belong just as much to
-a system as the collective members of the fauna of a Continent--is
-betrayed in the end by the circumstance: how unfailingly the most
-diverse philosophers always fill in again a definite fundamental scheme
-of POSSIBLE philosophies. Under an invisible spell, they always revolve
-once more in the same orbit, however independent of each other they
-may feel themselves with their critical or systematic wills, something
-within them leads them, something impels them in definite order the
-one after the other--to wit, the innate methodology and relationship
-of their ideas. Their thinking is, in fact, far less a discovery than a
-re-recognizing, a remembering, a return and a home-coming to a far-off,
-ancient common-household of the soul, out of which those ideas formerly
-grew: philosophizing is so far a kind of atavism of the highest order.
-The wonderful family resemblance of all Indian, Greek, and German
-philosophizing is easily enough explained. In fact, where there is
-affinity of language, owing to the common philosophy of grammar--I mean
-owing to the unconscious domination and guidance of similar grammatical
-functions--it cannot but be that everything is prepared at the outset
-for a similar development and succession of philosophical systems,
-just as the way seems barred against certain other possibilities of
-world-interpretation. It is highly probable that philosophers within the
-domain of the Ural-Altaic languages (where the conception of the subject
-is least developed) look otherwise "into the world," and will be
-found on paths of thought different from those of the Indo-Germans and
-Mussulmans, the spell of certain grammatical functions is ultimately
-also the spell of PHYSIOLOGICAL valuations and racial conditions.--So
-much by way of rejecting Locke's superficiality with regard to the
-origin of ideas.
-
-21. The CAUSA SUI is the best self-contradiction that has yet been
-conceived, it is a sort of logical violation and unnaturalness; but the
-extravagant pride of man has managed to entangle itself profoundly and
-frightfully with this very folly. The desire for "freedom of will"
-in the superlative, metaphysical sense, such as still holds sway,
-unfortunately, in the minds of the half-educated, the desire to bear
-the entire and ultimate responsibility for one's actions oneself, and
-to absolve God, the world, ancestors, chance, and society therefrom,
-involves nothing less than to be precisely this CAUSA SUI, and, with
-more than Munchausen daring, to pull oneself up into existence by the
-hair, out of the slough of nothingness. If any one should find out in
-this manner the crass stupidity of the celebrated conception of "free
-will" and put it out of his head altogether, I beg of him to carry
-his "enlightenment" a step further, and also put out of his head the
-contrary of this monstrous conception of "free will": I mean "non-free
-will," which is tantamount to a misuse of cause and effect. One
-should not wrongly MATERIALISE "cause" and "effect," as the natural
-philosophers do (and whoever like them naturalize in thinking at
-present), according to the prevailing mechanical doltishness which makes
-the cause press and push until it "effects" its end; one should use
-"cause" and "effect" only as pure CONCEPTIONS, that is to say, as
-conventional fictions for the purpose of designation and mutual
-understanding,--NOT for explanation. In "being-in-itself" there is
-nothing of "casual-connection," of "necessity," or of "psychological
-non-freedom"; there the effect does NOT follow the cause, there "law"
-does not obtain. It is WE alone who have devised cause, sequence,
-reciprocity, relativity, constraint, number, law, freedom, motive,
-and purpose; and when we interpret and intermix this symbol-world,
-as "being-in-itself," with things, we act once more as we have always
-acted--MYTHOLOGICALLY. The "non-free will" is mythology; in real life
-it is only a question of STRONG and WEAK wills.--It is almost always
-a symptom of what is lacking in himself, when a thinker, in every
-"causal-connection" and "psychological necessity," manifests something
-of compulsion, indigence, obsequiousness, oppression, and non-freedom;
-it is suspicious to have such feelings--the person betrays himself. And
-in general, if I have observed correctly, the "non-freedom of the will"
-is regarded as a problem from two entirely opposite standpoints, but
-always in a profoundly PERSONAL manner: some will not give up their
-"responsibility," their belief in THEMSELVES, the personal right to
-THEIR merits, at any price (the vain races belong to this class); others
-on the contrary, do not wish to be answerable for anything, or blamed
-for anything, and owing to an inward self-contempt, seek to GET OUT OF
-THE BUSINESS, no matter how. The latter, when they write books, are
-in the habit at present of taking the side of criminals; a sort of
-socialistic sympathy is their favourite disguise. And as a matter of
-fact, the fatalism of the weak-willed embellishes itself surprisingly
-when it can pose as "la religion de la souffrance humaine"; that is ITS
-"good taste."
-
-22. Let me be pardoned, as an old philologist who cannot desist from
-the mischief of putting his finger on bad modes of interpretation, but
-"Nature's conformity to law," of which you physicists talk so proudly,
-as though--why, it exists only owing to your interpretation and bad
-"philology." It is no matter of fact, no "text," but rather just a
-naively humanitarian adjustment and perversion of meaning, with which
-you make abundant concessions to the democratic instincts of the modern
-soul! "Everywhere equality before the law--Nature is not different in
-that respect, nor better than we": a fine instance of secret motive,
-in which the vulgar antagonism to everything privileged and
-autocratic--likewise a second and more refined atheism--is once more
-disguised. "Ni dieu, ni maitre"--that, also, is what you want; and
-therefore "Cheers for natural law!"--is it not so? But, as has been
-said, that is interpretation, not text; and somebody might come along,
-who, with opposite intentions and modes of interpretation, could read
-out of the same "Nature," and with regard to the same phenomena, just
-the tyrannically inconsiderate and relentless enforcement of the claims
-of power--an interpreter who should so place the unexceptionalness and
-unconditionalness of all "Will to Power" before your eyes, that almost
-every word, and the word "tyranny" itself, would eventually seem
-unsuitable, or like a weakening and softening metaphor--as being too
-human; and who should, nevertheless, end by asserting the same about
-this world as you do, namely, that it has a "necessary" and "calculable"
-course, NOT, however, because laws obtain in it, but because they are
-absolutely LACKING, and every power effects its ultimate consequences
-every moment. Granted that this also is only interpretation--and you
-will be eager enough to make this objection?--well, so much the better.
-
-23. All psychology hitherto has run aground on moral prejudices and
-timidities, it has not dared to launch out into the depths. In so far
-as it is allowable to recognize in that which has hitherto been written,
-evidence of that which has hitherto been kept silent, it seems as if
-nobody had yet harboured the notion of psychology as the Morphology
-and DEVELOPMENT-DOCTRINE OF THE WILL TO POWER, as I conceive of it.
-The power of moral prejudices has penetrated deeply into the most
-intellectual world, the world apparently most indifferent and
-unprejudiced, and has obviously operated in an injurious, obstructive,
-blinding, and distorting manner. A proper physio-psychology has to
-contend with unconscious antagonism in the heart of the investigator,
-it has "the heart" against it even a doctrine of the reciprocal
-conditionalness of the "good" and the "bad" impulses, causes (as
-refined immorality) distress and aversion in a still strong and manly
-conscience--still more so, a doctrine of the derivation of all good
-impulses from bad ones. If, however, a person should regard even
-the emotions of hatred, envy, covetousness, and imperiousness
-as life-conditioning emotions, as factors which must be present,
-fundamentally and essentially, in the general economy of life (which
-must, therefore, be further developed if life is to be further
-developed), he will suffer from such a view of things as from
-sea-sickness. And yet this hypothesis is far from being the strangest
-and most painful in this immense and almost new domain of dangerous
-knowledge, and there are in fact a hundred good reasons why every one
-should keep away from it who CAN do so! On the other hand, if one has
-once drifted hither with one's bark, well! very good! now let us set our
-teeth firmly! let us open our eyes and keep our hand fast on the helm!
-We sail away right OVER morality, we crush out, we destroy perhaps the
-remains of our own morality by daring to make our voyage thither--but
-what do WE matter. Never yet did a PROFOUNDER world of insight reveal
-itself to daring travelers and adventurers, and the psychologist who
-thus "makes a sacrifice"--it is not the sacrifizio dell' intelletto,
-on the contrary!--will at least be entitled to demand in return that
-psychology shall once more be recognized as the queen of the sciences,
-for whose service and equipment the other sciences exist. For psychology
-is once more the path to the fundamental problems.
View
30 samples/wordcount/build.gradle
@@ -1,30 +0,0 @@
-description = 'Spring Hadoop Samples - WordCount'
-
-apply plugin: 'base'
-apply plugin: 'java'
-apply plugin: 'idea'
-apply plugin: 'eclipse'
-apply plugin: 'application'
-
-repositories {
- // Public Spring artefacts
- maven { url "http://repo.springsource.org/libs-snapshot" }
-}
-
-//load version from the root folder
-def props = new Properties();
-new File("../gradle.properties").withInputStream { props.load(it) }
-props.each({ project.ext[it.key] = it.value } )
-version = project.ext.version
-
-dependencies {
- compile "org.springframework.data:spring-data-hadoop:$version"
- compile "org.apache.hadoop:hadoop-examples:$hadoopVersion"
-
- testCompile "junit:junit:$junitVersion"
- testCompile "org.springframework:spring-test:$springVersion"
-}
-
-sourceSets { main { resources { srcDir file('../resources') } } }
-mainClassName = "org.springframework.data.hadoop.samples.wordcount.Main"
-defaultTasks 'run'
View
38 samples/wordcount/readme.txt
@@ -1,38 +0,0 @@
-====================
-== WordCount Demo ==
-====================
-
-1. MOTIVATION
-
-A basic word count demo that illustrates the configuration and interaction with Hadoop through Spring Hadoop.
-The demo copies local resources into HDFS and executes the Hadoop example that counts words against it. The demo
-requires a running Hadoop instance (by default at localhost:9000).
-The Hadoop settings can be configured through hadoop.properties (more info in the Spring Hadoop reference docs).
-
-2. BUILD AND DEPLOYMENT
-
-This directory contains the source files.
-For building, JDK 1.6+ are required
-
-a) To build, test and run the sample, use the following command:
-
-*nix/BSD OS:
-$ ../gradlew
-
-Windows OS:
-$ ..\gradlew
-
-If you have Gradle installed and available in your classpath, you can simply type:
-$ gradle
-
-3. IDE IMPORT
-
-To import the code inside an IDE run the command
-
-For Eclipse
-$ ../gradlew eclipse
-
-For IDEA
-$ ../gradlew idea
-
-This will generate the IDE specific project files.
View
45 samples/wordcount/src/main/java/org/springframework/data/hadoop/samples/wordcount/Main.java
@@ -1,45 +0,0 @@
-/*
- * Copyright 2011-2012 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.springframework.data.hadoop.samples.wordcount;
-
-import org.springframework.context.support.AbstractApplicationContext;
-import org.springframework.context.support.ClassPathXmlApplicationContext;
-
-/**
- * WordCount startup class.
- * Bootstraps the Spring container which deploys and runs a Map-Reduce job.
- * <p/>
- * Accepts as optional parameters location of one (or multiple) application contexts that will
- * be used for configuring the Spring container. See the reference documentation for more
- * {@link http://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/html/resources.html information}.
- *
- * Note that in most (if not all) managed environments writing such a class is not needed
- * as Spring already provides the required integration.
- *
- * @see org.springframework.web.context.ContextLoaderListener
- * @author Costin Leau
- */
-public class Main {
-
- private static final String[] CONFIGS = new String[] { "META-INF/spring/context.xml" };
-
- public static void main(String[] args) {
- String[] res = (args != null && args.length > 0 ? args : CONFIGS);
- AbstractApplicationContext ctx = new ClassPathXmlApplicationContext(res);
- // shutdown the context along with the VM
- ctx.registerShutdownHook();
- }
-}
View
33 samples/wordcount/src/main/resources/META-INF/spring/context.xml
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:context="http://www.springframework.org/schema/context"
- xmlns:hdp="http://www.springframework.org/schema/hadoop"
- xmlns:p="http://www.springframework.org/schema/p"
- xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
- http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
- http://www.springframework.org/schema/hadoop http://www.springframework.org/schema/hadoop/spring-hadoop.xsd">
-
-
- <context:property-placeholder location="hadoop.properties"/>
-
- <hdp:configuration>
- fs.default.name=${hd.fs}
- </hdp:configuration>
-
- <hdp:job id="wordcount-job" validate-paths="false"
- input-path="${wordcount.input.path}" output-path="${wordcount.output.path}"
- mapper="org.apache.hadoop.examples.WordCount.TokenizerMapper"
- reducer="org.apache.hadoop.examples.WordCount.IntSumReducer"/>
-
-
- <hdp:script id="setup-script" location="cp-data.js" >
- <hdp:property name="inputPath" value="${wordcount.input.path}" />
- <hdp:property name="outputPath" value="${wordcount.output.path}" />
- <hdp:property name="localResource" value="${local.data}" />
- </hdp:script>
-
- <!-- simple job runner -->
- <bean id="runner" class="org.springframework.data.hadoop.mapreduce.JobRunner" depends-on="setup-script" p:jobs-ref="wordcount-job"/>
-
-</beans>
View
27 samples/wordcount/src/main/resources/cp-data.js
@@ -1,27 +0,0 @@
-//
-// Simple script that prepares the HDFS env for a Hadoop job:
-//
-// 1. deletes the input/output paths in HDFS (in case they exist)
-// 2. copies a local resource to HDFS
-//
-// required params are:
-// * inputPath
-// * outputPath
-// * localResource
-
-
-// 'hack' default permissions to make Hadoop work on Windows
-if (java.lang.System.getProperty("os.name").startsWith("Windows")) {
- // 0655 = -rwxr-xr-x
- org.apache.hadoop.mapreduce.JobSubmissionFiles.JOB_DIR_PERMISSION.fromShort(0655)
- org.apache.hadoop.mapreduce.JobSubmissionFiles.JOB_FILE_PERMISSION.fromShort(0655)
-}
-
-
-// delete job paths
-if (fsh.test(inputPath)) { fsh.rmr(inputPath) }
-if (fsh.test(outputPath)) { fsh.rmr(outputPath) }
-
-// copy local resource using the streams directly (to be portable across envs)
-inStream = cl.getResourceAsStream(localResource)
-org.apache.hadoop.io.IOUtils.copyBytes(inStream, fs.create(inputPath), cfg)
View
6 samples/wordcount/src/main/resources/hadoop.properties
@@ -1,6 +0,0 @@
-wordcount.input.path=/user/gutenberg/input/word/
-wordcount.output.path=/user/gutenberg/output/word/
-local.data=data/nietzsche-chapter-1.txt
-
-hd.fs=hdfs://localhost:9000
-mapred.job.tracker=localhost:9001
View
8 samples/wordcount/src/main/resources/log4j.properties
@@ -1,8 +0,0 @@
-log4j.rootCategory=INFO, stdout
-
-log4j.appender.stdout=org.apache.log4j.ConsoleAppender
-log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
-log4j.appender.stdout.layout.ConversionPattern=%d %p [%c] - <%m>%n
-
-# for debugging datasource initialization
-# log4j.category.test.jdbc=DEBUG
View
24 ...rdcount/src/test/java/org/springframework/data/hadoop/samples/Word