public static void writeWritablesToFile(String outputPath,String delim,List<List<Writable>> writables,JavaSparkContext sc) throws IOException {
  StringBuilder sb=new StringBuilder();
  for (  List<Writable> list : writables) {
    boolean first=true;
    for (    Writable w : list) {
      sb.append(w.toString());
      if (!first)       sb.append(delim);
      first=false;
    }
    sb.append("\n");
  }
  writeStringToFile(outputPath,sb.toString(),sc);
}

public static void writeWritablesToFile ( String outputPath , String delim , List < List < Writable > > writables , JavaSparkContext sc ) throws IOException { StringBuilder sb = new StringBuilder ( ) ; for ( List < Writable > list : writables ) { boolean first = true ; for ( Writable w : list ) { sb . append ( w . toString ( ) ) ; if ( ! first ) sb . append ( delim ) ; first = false ; } sb . append ( "\n" ) ; } writeStringToFile ( outputPath , sb . toString ( ) , sc ) ; }
wlite a set of writables ( or , sequence ) to hdfs ( or , locally ) .
