Package org.apache.spark.api.java

Examples of org.apache.spark.api.java.JavaPairRDD.map()


        long messages = data.filter(new Function<Tuple2<Text, MapWritable>, Boolean>() {
            public Boolean call(Tuple2<Text, MapWritable> t) { return t._2.containsKey(new Text("message")); }
        }).count();

        JavaRDD map = data.map(new Function<Tuple2<Text, MapWritable>, Map<String, Object>>() {
            public Map<String, Object> call(Tuple2<Text, MapWritable> v1) throws Exception {
                return (Map<String, Object>) WritableUtils.fromWritable(v1._2);
            }
        });
View Full Code Here


            public Map<String, Object> call(Tuple2<Text, MapWritable> v1) throws Exception {
                return (Map<String, Object>) WritableUtils.fromWritable(v1._2);
            }
        });

        JavaRDD fooBar = data.map(new Function<Tuple2<Text, MapWritable>, String>() {
            public String call(Tuple2<Text, MapWritable> v1) throws Exception {
                return v1._1.toString();
            }
        });
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.