Skip to content

Instantly share code, notes, and snippets.

@mraad
Last active December 14, 2015 11:29
Show Gist options
  • Save mraad/5079299 to your computer and use it in GitHub Desktop.
Save mraad/5079299 to your computer and use it in GitHub Desktop.
Kernel Density Spring Configuration
<?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:hdp="http://www.springframework.org/schema/hadoop"
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">
<hdp:configuration id="hadoopConfiguration">
fs.defaultFS=hdfs://10.12.51.70:8020
mapred.job.tracker=10.12.51.70:8021
mapred.child.java.opts=-Xmx1024m
com.esri.xmin=-180.0
com.esri.ymin=-90.0
com.esri.xmax=180.0
com.esri.ymax=90.0
com.esri.cellSize=1
com.esri.searchRadius=3
</hdp:configuration>
<hdp:job id="mr-job"
jar-by-class="com.esri.density.Main"
input-path="/pi/input"
output-path="/pi/output"
mapper="com.esri.density.DensityMapper"
combiner="com.esri.density.DensityReducer"
reducer="com.esri.density.DensityReducer"/>
<hdp:script id="preAction" language="javascript">
if (fsh.test("/pi/output")){
fsh.rmr("/pi/output")
}
</hdp:script>
<bean id="postAction" class="com.esri.density.RasterFloat">
<property name="configuration" ref="hadoopConfiguration"/>
<property name="hdfsPath" value="/pi/output"/>
<property name="filePath" value="/tmp/raster.flt"/>
</bean>
<hdp:job-runner id="runner"
run-at-startup="true"
pre-action="preAction"
post-action="postAction"
job-ref="mr-job"/>
</beans>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment