@Test public void testWritePropertyGraphUpdate() throws Exception { ConfigurationLoader.testPropertyAccess=true; String nodeList = "0 .001\n" + "1 .002\n" + "3 .003"; String path = ConfigurationLoader.getInstance().getHadoopHdfsUri() + "/test/propertyNodeList.txt"; FileUtil.writePropertyGraphUpdate(new ProcessorMessage(path, GraphProcessor.PAGERANK, ProcessorMode.Partitioned), new ArrayList<>(Arrays.asList( "0 .001\n", "1 .002\n", "3 .003" ))); assertEquals(FileUtil.readHdfsFile(path), "# Node Property Value List" + "\n" + nodeList); }
public static void writePropertyGraphUpdate(ProcessorMessage processorMessage, Iterable<String> nodeList) throws URISyntaxException, IOException { int lineCount = writeListFile(processorMessage.getPath(), nodeList.iterator()); if(lineCount > 0) { Gson gson = new Gson(); String message = gson.toJson(processorMessage); Sender.sendMessage(message); } }
FileUtil { public static void writePropertyGraphUpdate(ProcessorMessage processorMessage, Iterable<String> nodeList) throws URISyntaxException, IOException { int lineCount = writeListFile(processorMessage.getPath(), nodeList.iterator()); if(lineCount > 0) { Gson gson = new Gson(); String message = gson.toJson(processorMessage); Sender.sendMessage(message); } } }
FileUtil { public static void writePropertyGraphUpdate(ProcessorMessage processorMessage, Iterable<String> nodeList) throws URISyntaxException, IOException { int lineCount = writeListFile(processorMessage.getPath(), nodeList.iterator()); if(lineCount > 0) { Gson gson = new Gson(); String message = gson.toJson(processorMessage); Sender.sendMessage(message); } }  }
FileUtil { public static void writePropertyGraphUpdate(ProcessorMessage processorMessage, Iterable<String> nodeList) throws URISyntaxException, IOException { int lineCount = writeListFile(processorMessage.getPath(), nodeList.iterator()); if(lineCount > 0) { Gson gson = new Gson(); String message = gson.toJson(processorMessage); Sender.sendMessage(message); } }  static void writePropertyGraphUpdate(ProcessorMessage processorMessage, Iterable<String> nodeList); static int writeListFile(String path, Iterator<String> nodeList); static String readHdfsFile(String path); static FileSystem getHadoopFileSystem(); }
FileUtil { public static void writePropertyGraphUpdate(ProcessorMessage processorMessage, Iterable<String> nodeList) throws URISyntaxException, IOException { int lineCount = writeListFile(processorMessage.getPath(), nodeList.iterator()); if(lineCount > 0) { Gson gson = new Gson(); String message = gson.toJson(processorMessage); Sender.sendMessage(message); } }  static void writePropertyGraphUpdate(ProcessorMessage processorMessage, Iterable<String> nodeList); static int writeListFile(String path, Iterator<String> nodeList); static String readHdfsFile(String path); static FileSystem getHadoopFileSystem();  }