@Test public void testMapper() throws IOException, URISyntaxException { MapDriver<LongWritable, Text, Text, Text> mapDriver; JpylyzerMapper mapper = new JpylyzerMapper(); String name = "B400022028241-RT1/balloon.jp2"; mapDriver = MapDriver.newMapDriver(mapper); File testFolder = new File(Thread.currentThread().getContextClassLoader().getResource(name).toURI()) .getParentFile() .getParentFile() .getParentFile() .getParentFile(); File jpylyzerPath = new File(testFolder, "src/test/extras/jpylyzer-1.10.1/jpylyzer.py"); mapDriver .getConfiguration() .set( dk.statsbiblioteket.medieplatform.autonomous.ConfigConstants.JPYLYZER_PATH, jpylyzerPath.getAbsolutePath()); String testFile = getAbsolutePath(name); mapDriver.withInput(new LongWritable(1), new Text(testFile)); mapDriver.withOutput( new Text(testFile), Utils.asText(JpylyzerMapper.jpylize(testFile, jpylyzerPath.getAbsolutePath()))); mapDriver.runTest(); }
@Before public void setUp() throws Exception { MyMapper mapper = new MyMapper(); MyReducer reducer = new MyReducer(); mapDriver = MapDriver.newMapDriver(mapper); reduceDriver = ReduceDriver.newReduceDriver(reducer); mapReduceDriver = MapReduceDriver.newMapReduceDriver(mapper, reducer); }
@Before public void setUp() { IpMapper mapper = new IpMapper(); IpReducer reducer = new IpReducer(); mapDriver = MapDriver.newMapDriver(mapper); reduceDriver = ReduceDriver.newReduceDriver(reducer); mapReduceDriver = MapReduceDriver.newMapReduceDriver(mapper, reducer); }
@Before public void setup() { TrigramMapper mapper = new TrigramMapper(); TrigramReducer reducer = new TrigramReducer(); mapDriver = MapDriver.newMapDriver(mapper); reduceDriver = ReduceDriver.newReduceDriver(reducer); }
@Before public void setup() throws FileNotFoundException { TitleWordCountMapper mapper = new TitleWordCountMapper(); TitleWordCountReducer reducer = new TitleWordCountReducer(); mapDriver = MapDriver.newMapDriver(mapper); reduceDriver = ReduceDriver.newReduceDriver(reducer); }
@Before public void setUp() throws Exception { PymkMapper mapper = new PymkMapper(); mapDriver = MapDriver.newMapDriver(mapper); PymkReducer reducer = new PymkReducer(); reducerDriver = ReduceDriver.newReduceDriver(reducer); mapRedDriver = MapReduceDriver.newMapReduceDriver(mapper, reducer); }
@Test public void testSimplest() throws IOException { MapDriver<LongWritable, Text, Text, Text> mapDriver; JpylyzerMapper mapper = new JpylyzerMapper(); mapDriver = MapDriver.newMapDriver(mapper); mapDriver .getConfiguration() .set(dk.statsbiblioteket.medieplatform.autonomous.ConfigConstants.JPYLYZER_PATH, "echo"); mapDriver.withInput(new LongWritable(1), new Text("ein")); mapDriver.withOutput(new Text("ein"), new Text("ein")); mapDriver.runTest(); }
@Before public void setUp() throws IOException { mapDriver = MapDriver.newMapDriver(nnMapper); reduceDriver = ReduceDriver.newReduceDriver(nnReducer); mapDriver .getConfiguration() .set( GeoWaveConfiguratorBase.enumToConfKey( NNMapReduce.class, PartitionParameters.Partition.DISTANCE_THRESHOLDS), "10,10"); reduceDriver .getConfiguration() .setDouble( GeoWaveConfiguratorBase.enumToConfKey( NNMapReduce.class, PartitionParameters.Partition.MAX_DISTANCE), 10); ftype = AnalyticFeature.createGeometryFeatureAdapter( "centroid", new String[] {"extra1"}, BasicFeatureTypes.DEFAULT_NAMESPACE, ClusteringUtils.CLUSTERING_CRS) .getType(); reduceDriver .getConfiguration() .setClass( GeoWaveConfiguratorBase.enumToConfKey( DBScanMapReduce.class, HullParameters.Hull.PROJECTION_CLASS), SimpleFeatureProjection.class, Projection.class); JobContextAdapterStore.addDataAdapter( mapDriver.getConfiguration(), new FeatureDataAdapter(ftype)); JobContextAdapterStore.addDataAdapter( reduceDriver.getConfiguration(), new FeatureDataAdapter(ftype)); serializations(); }
@Before public void setup() { WordMapper mapper = new WordMapper(); mapDriver = MapDriver.newMapDriver(mapper); }