org.apache.flink.test.testdata.PageRankData Java Examples

The following examples show how to use org.apache.flink.test.testdata.PageRankData. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: PageRankITCase.java    From Flink-CEPplus with Apache License 2.0 6 votes vote down vote up
@Before
public void before() throws Exception{
	File resultFile = tempFolder.newFile();
	//Delete file because the Scala API does not respect WriteMode set by the configuration
	resultFile.delete();
	resultPath = resultFile.toURI().toString();

	File verticesFile = tempFolder.newFile();
	FileUtils.writeFileUtf8(verticesFile, PageRankData.VERTICES);

	File edgesFile = tempFolder.newFile();
	FileUtils.writeFileUtf8(edgesFile, PageRankData.EDGES);

	verticesPath = verticesFile.toURI().toString();
	edgesPath = edgesFile.toURI().toString();
}
 
Example #2
Source File: PageRankITCase.java    From flink with Apache License 2.0 6 votes vote down vote up
@Before
public void before() throws Exception{
	File resultFile = tempFolder.newFile();
	//Delete file because the Scala API does not respect WriteMode set by the configuration
	resultFile.delete();
	resultPath = resultFile.toURI().toString();

	File verticesFile = tempFolder.newFile();
	FileUtils.writeFileUtf8(verticesFile, PageRankData.VERTICES);

	File edgesFile = tempFolder.newFile();
	FileUtils.writeFileUtf8(edgesFile, PageRankData.EDGES);

	verticesPath = verticesFile.toURI().toString();
	edgesPath = edgesFile.toURI().toString();
}
 
Example #3
Source File: PageRankITCase.java    From flink with Apache License 2.0 6 votes vote down vote up
@Before
public void before() throws Exception{
	File resultFile = tempFolder.newFile();
	//Delete file because the Scala API does not respect WriteMode set by the configuration
	resultFile.delete();
	resultPath = resultFile.toURI().toString();

	File verticesFile = tempFolder.newFile();
	FileUtils.writeFileUtf8(verticesFile, PageRankData.VERTICES);

	File edgesFile = tempFolder.newFile();
	FileUtils.writeFileUtf8(edgesFile, PageRankData.EDGES);

	verticesPath = verticesFile.toURI().toString();
	edgesPath = edgesFile.toURI().toString();
}
 
Example #4
Source File: PageRankITCase.java    From flink with Apache License 2.0 5 votes vote down vote up
@Test
public void testPageRankWithConvergence() throws Exception {
	// start with a very high number of iteration such that the dynamic convergence criterion must handle termination
	PageRankBasic.main(new String[] {
			"--pages", verticesPath,
			"--links", edgesPath,
			"--output", resultPath,
			"--numPages", PageRankData.NUM_VERTICES + "",
			"--iterations", "1000"});
	expected = PageRankData.RANKS_AFTER_EPSILON_0_0001_CONVERGENCE;
}
 
Example #5
Source File: PageRankITCase.java    From Flink-CEPplus with Apache License 2.0 5 votes vote down vote up
@Before
public void before() throws Exception{
	final File folder = tempFolder.newFolder();
	final File resultFile = new File(folder, UUID.randomUUID().toString());
	resultPath = resultFile.toURI().toString();

	File verticesFile = tempFolder.newFile();
	FileUtils.writeFileUtf8(verticesFile, PageRankData.VERTICES);

	File edgesFile = tempFolder.newFile();
	FileUtils.writeFileUtf8(edgesFile, PageRankData.EDGES);

	verticesPath = verticesFile.toURI().toString();
	edgesPath = edgesFile.toURI().toString();
}
 
Example #6
Source File: PageRankITCase.java    From flink with Apache License 2.0 5 votes vote down vote up
@Test
public void testPageRankWithSmallNumberOfIterations() throws Exception {
	PageRankBasic.main(new String[] {
			"--pages", verticesPath,
			"--links", edgesPath,
			"--output", resultPath,
			"--numPages", PageRankData.NUM_VERTICES + "",
			"--iterations", "3"});
	expected = PageRankData.RANKS_AFTER_3_ITERATIONS;
}
 
Example #7
Source File: PageRankITCase.java    From flink with Apache License 2.0 5 votes vote down vote up
@Test
public void testPageRankWithConvergenceCriterion() throws Exception {
	PageRank.main(new String[]{
			"--pages", verticesPath,
			"--links", edgesPath,
			"--output", resultPath,
			"--numPages", PageRankData.NUM_VERTICES + "",
			"--vertices", "1000"});
	expected = PageRankData.RANKS_AFTER_EPSILON_0_0001_CONVERGENCE;
}
 
Example #8
Source File: PageRankITCase.java    From flink with Apache License 2.0 5 votes vote down vote up
@Test
public void testPageRankSmallNumberOfIterations() throws Exception {
	PageRank.main(new String[]{
			"--pages", verticesPath,
			"--links", edgesPath,
			"--output", resultPath,
			"--numPages", PageRankData.NUM_VERTICES + "",
			"--iterations", "3"});
	expected =  PageRankData.RANKS_AFTER_3_ITERATIONS;
}
 
Example #9
Source File: PageRankITCase.java    From flink with Apache License 2.0 5 votes vote down vote up
@Before
public void before() throws Exception{
	final File folder = tempFolder.newFolder();
	final File resultFile = new File(folder, UUID.randomUUID().toString());
	resultPath = resultFile.toURI().toString();

	File verticesFile = tempFolder.newFile();
	FileUtils.writeFileUtf8(verticesFile, PageRankData.VERTICES);

	File edgesFile = tempFolder.newFile();
	FileUtils.writeFileUtf8(edgesFile, PageRankData.EDGES);

	verticesPath = verticesFile.toURI().toString();
	edgesPath = edgesFile.toURI().toString();
}
 
Example #10
Source File: PageRankITCase.java    From flink with Apache License 2.0 5 votes vote down vote up
@Test
public void testPageRankWithConvergence() throws Exception {
	// start with a very high number of iteration such that the dynamic convergence criterion must handle termination
	PageRankBasic.main(new String[] {
			"--pages", verticesPath,
			"--links", edgesPath,
			"--output", resultPath,
			"--numPages", PageRankData.NUM_VERTICES + "",
			"--iterations", "1000"});
	expected = PageRankData.RANKS_AFTER_EPSILON_0_0001_CONVERGENCE;
}
 
Example #11
Source File: PageRankITCase.java    From flink with Apache License 2.0 5 votes vote down vote up
@Test
public void testPageRankWithSmallNumberOfIterations() throws Exception {
	PageRankBasic.main(new String[] {
			"--pages", verticesPath,
			"--links", edgesPath,
			"--output", resultPath,
			"--numPages", PageRankData.NUM_VERTICES + "",
			"--iterations", "3"});
	expected = PageRankData.RANKS_AFTER_3_ITERATIONS;
}
 
Example #12
Source File: PageRankITCase.java    From flink with Apache License 2.0 5 votes vote down vote up
@Test
public void testPageRankWithConvergenceCriterion() throws Exception {
	PageRank.main(new String[]{
			"--pages", verticesPath,
			"--links", edgesPath,
			"--output", resultPath,
			"--numPages", PageRankData.NUM_VERTICES + "",
			"--vertices", "1000"});
	expected = PageRankData.RANKS_AFTER_EPSILON_0_0001_CONVERGENCE;
}
 
Example #13
Source File: PageRankITCase.java    From flink with Apache License 2.0 5 votes vote down vote up
@Test
public void testPageRankSmallNumberOfIterations() throws Exception {
	PageRank.main(new String[]{
			"--pages", verticesPath,
			"--links", edgesPath,
			"--output", resultPath,
			"--numPages", PageRankData.NUM_VERTICES + "",
			"--iterations", "3"});
	expected =  PageRankData.RANKS_AFTER_3_ITERATIONS;
}
 
Example #14
Source File: PageRankITCase.java    From flink with Apache License 2.0 5 votes vote down vote up
@Before
public void before() throws Exception{
	final File folder = tempFolder.newFolder();
	final File resultFile = new File(folder, UUID.randomUUID().toString());
	resultPath = resultFile.toURI().toString();

	File verticesFile = tempFolder.newFile();
	FileUtils.writeFileUtf8(verticesFile, PageRankData.VERTICES);

	File edgesFile = tempFolder.newFile();
	FileUtils.writeFileUtf8(edgesFile, PageRankData.EDGES);

	verticesPath = verticesFile.toURI().toString();
	edgesPath = edgesFile.toURI().toString();
}
 
Example #15
Source File: PageRankITCase.java    From Flink-CEPplus with Apache License 2.0 5 votes vote down vote up
@Test
public void testPageRankWithConvergence() throws Exception {
	// start with a very high number of iteration such that the dynamic convergence criterion must handle termination
	PageRankBasic.main(new String[] {
			"--pages", verticesPath,
			"--links", edgesPath,
			"--output", resultPath,
			"--numPages", PageRankData.NUM_VERTICES + "",
			"--iterations", "1000"});
	expected = PageRankData.RANKS_AFTER_EPSILON_0_0001_CONVERGENCE;
}
 
Example #16
Source File: PageRankITCase.java    From Flink-CEPplus with Apache License 2.0 5 votes vote down vote up
@Test
public void testPageRankWithSmallNumberOfIterations() throws Exception {
	PageRankBasic.main(new String[] {
			"--pages", verticesPath,
			"--links", edgesPath,
			"--output", resultPath,
			"--numPages", PageRankData.NUM_VERTICES + "",
			"--iterations", "3"});
	expected = PageRankData.RANKS_AFTER_3_ITERATIONS;
}
 
Example #17
Source File: PageRankITCase.java    From Flink-CEPplus with Apache License 2.0 5 votes vote down vote up
@Test
public void testPageRankWithConvergenceCriterion() throws Exception {
	PageRank.main(new String[]{
			"--pages", verticesPath,
			"--links", edgesPath,
			"--output", resultPath,
			"--numPages", PageRankData.NUM_VERTICES + "",
			"--vertices", "1000"});
	expected = PageRankData.RANKS_AFTER_EPSILON_0_0001_CONVERGENCE;
}
 
Example #18
Source File: PageRankITCase.java    From Flink-CEPplus with Apache License 2.0 5 votes vote down vote up
@Test
public void testPageRankSmallNumberOfIterations() throws Exception {
	PageRank.main(new String[]{
			"--pages", verticesPath,
			"--links", edgesPath,
			"--output", resultPath,
			"--numPages", PageRankData.NUM_VERTICES + "",
			"--iterations", "3"});
	expected =  PageRankData.RANKS_AFTER_3_ITERATIONS;
}