本文整理了Java中org.apache.spark.rdd.RDD.dependencies
方法的一些代码示例,展示了RDD.dependencies
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。RDD.dependencies
方法的具体详情如下:
包路径:org.apache.spark.rdd.RDD
类名称:RDD
方法名:dependencies
暂无
代码示例来源:origin: apache/drill
private static void rddToString(RDD rdd, StringBuilder sb, String offset) {
sb.append(offset).append(rdd.getClass().getCanonicalName()).append("[").append(rdd.hashCode()).append("]");
if (rdd.getStorageLevel().useMemory()) {
sb.append("(cached)");
}
sb.append("\n");
Collection<Dependency> dependencies = JavaConversions.asJavaCollection(rdd.dependencies());
if (dependencies != null) {
offset += "\t";
for (Dependency dependency : dependencies) {
RDD parentRdd = dependency.rdd();
rddToString(parentRdd, sb, offset);
}
} else if (rdd instanceof UnionRDD) {
UnionRDD unionRDD = (UnionRDD) rdd;
offset += "\t";
Collection<RDD> parentRdds = JavaConversions.asJavaCollection(unionRDD.rdds());
for (RDD parentRdd : parentRdds) {
rddToString(parentRdd, sb, offset);
}
}
}
代码示例来源:origin: apache/hive
Assert.assertTrue(reducerRdd.creationSite().longForm().contains("Reducer 2"));
List<Dependency<?>> rdds = JavaConversions.seqAsJavaList(reducerRdd.dependencies());
Assert.assertEquals(1, rdds.size());
RDD shuffledRdd = rdds.get(0).rdd();
Assert.assertTrue(shuffledRdd.creationSite().longForm().contains("Reducer 2"));
rdds = JavaConversions.seqAsJavaList(shuffledRdd.dependencies());
Assert.assertEquals(1, rdds.size());
RDD mapRdd = rdds.get(0).rdd();
Assert.assertTrue(mapRdd.creationSite().longForm().contains("Map 1"));
rdds = JavaConversions.seqAsJavaList(mapRdd.dependencies());
Assert.assertEquals(1, rdds.size());
RDD hadoopRdd = rdds.get(0).rdd();
内容来源于网络,如有侵权,请联系作者删除!