@@ -0,0 +1,1791 @@
+import java.io.BufferedReader;%0Aimport java.io.DataInputStream;%0Aimport java.io.File;%0Aimport java.io.FileInputStream;%0Aimport java.io.FileWriter;%0Aimport java.io.InputStream;%0Aimport java.io.InputStreamReader;%0Aimport java.io.OutputStream;%0Aimport java.util.HashMap;%0Aimport java.util.HashSet;%0Aimport java.util.Map;%0Aimport java.util.Set;%0A%0A%0Apublic class TSVProcessor %7B%0A%09%0A%09public static File f;%0A%09public static InputStream in;%0A%09public static OutputStream out;%0A%09public static Map%3CInteger, Set%3CInteger%3E%3E memo;%0A%09%0A%09%0A%09public static void main(String%5B%5D args) %7B%0A%09%09try %7B%0A%09%09%09File file = new File(%22giraph-standard-input.txt%22);%0A%09%09%09file.createNewFile();%0A%09%09%09FileWriter writer = new FileWriter(file);%0A%09%09%09FileInputStream fstream = new FileInputStream(args%5B0%5D);%0A%09%09%09DataInputStream in = new DataInputStream(fstream);%0A%09%09%09BufferedReader br = new BufferedReader(new InputStreamReader(in));%0A%09%09%09String strLine = null;%0A%09%09%09memo = new HashMap%3CInteger, Set%3CInteger%3E%3E();%0A%09%09%09while ((strLine = br.readLine()) != null) %7B%0A%09%09%09%09if (!strLine.startsWith(%22#%22)) %7B%0A%09%09%09%09%09String%5B%5D token = strLine.split(%22%09%22);%0A%09%09%09%09%09int from = Integer.parseInt(token%5B0%5D);%0A%09%09%09%09%09int to = Integer.parseInt(token%5B1%5D);%0A%09%09%09%09%09if (memo.keySet().contains(from)) %7B%0A%09%09%09%09%09%09memo.get(from).add(to);%0A%09%09%09%09%09%7D else %7B%0A%09%09%09%09%09%09memo.put(from, new HashSet%3CInteger%3E());%0A%09%09%09%09%09%09memo.get(from).add(to);%0A%09%09%09%09%09%7D%0A%09%09%09%09%7D%0A%09%09%09%7D%0A%09%09%09in.close();%0A%09%09%09for (Integer i : memo.keySet()) %7B%0A%09%09%09%09int from = i;%0A%09%09%09%09writer.write(%22%5B%22 + from + %22,0,%22);%0A%09%09%09%09writer.write(%22%5B%22);%0A%09%09%09%09int left = memo.get(i).size();%0A%09%09%09%09for (Integer j : memo.get(i)) %7B%0A%09%09%09%09%09writer.write(%22%5B%22 + j + %22,1%5D%22);%0A%09%09%09%09%09left--;%0A%09%09%09%09%09if (left != 0) %7B%0A%09%09%09%09%09%09writer.write(%22,%22);%0A%09%09%09%09%09%7D%0A%09%09%09%09%7D%0A%09%09%09%09writer.write(%22%5D%5D%5Cn%22);%0A%09%09%09%7D%0A%09%09%09writer.flush();%0A%09%09%09writer.close();%0A%09%09%7D catch (Exception e) %7B%0A%09%09%09System.err.println(%22Error: %22 + e.getMessage());%0A%09%09%7D%0A%09%09%0A%09%7D%0A%7D%0A

Create TSVProcessor.java