spark-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From im281 <>
Subject flatmap pair
Date Fri, 09 Dec 2016 03:11:22 GMT

The class 'Detector' has a function 'detectFeature(cluster) 
However, the method has changed to return a list of features as opposed to
one feature as it is below.
How do I change this so it returns a list of feature objects instead

// creates key-value pairs for Isotope cluster ID and Isotope cluster
		// groups them by keys and passes
		// each collection of isotopes to the feature detector
		JavaPairRDD<String, String> features =
scans.flatMapToPair(keyData).groupByKey().mapValues(values -> {

			System.out.println("Inside Feature Detection Reduce !");
			Detector d = new Detector();
			ArrayList<IsotopeCluster> clusters = (ArrayList<IsotopeCluster>)
			return d.WriteFeatureValue(d.DetectFeature(clusters));

View this message in context:
Sent from the Apache Spark User List mailing list archive at

To unsubscribe e-mail:

View raw message