当前位置: 首页>>代码示例>>Java>>正文


Java RuntimeSetup类代码示例

本文整理汇总了Java中science.atlarge.graphalytics.execution.RuntimeSetup的典型用法代码示例。如果您正苦于以下问题:Java RuntimeSetup类的具体用法?Java RuntimeSetup怎么用?Java RuntimeSetup使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


RuntimeSetup类属于science.atlarge.graphalytics.execution包,在下文中一共展示了RuntimeSetup类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: run

import science.atlarge.graphalytics.execution.RuntimeSetup; //导入依赖的package包/类
@Override
public void run(RunSpecification runSpecification) throws PlatformExecutionException {

	BenchmarkRun benchmarkRun = runSpecification.getBenchmarkRun();
	BenchmarkRunSetup benchmarkRunSetup = runSpecification.getBenchmarkRunSetup();
	RuntimeSetup runtimeSetup = runSpecification.getRuntimeSetup();

	PowergraphJob job;
	Object params = benchmarkRun.getAlgorithmParameters();

	String logPath = benchmarkRunSetup.getLogDir().resolve("platform").toString();

	boolean graphDirected = benchmarkRun.getFormattedGraph().isDirected();
	String vertexFilePath = runtimeSetup.getLoadedGraph().getVertexPath();
	String edgeFilePath = runtimeSetup.getLoadedGraph().getEdgePath();

	switch(benchmarkRun.getAlgorithm()) {
		case BFS:
			job = new BreadthFirstSearchJob(benchmarkConfig, vertexFilePath, edgeFilePath,
					graphDirected, (BreadthFirstSearchParameters) params, benchmarkRun.getId(), logPath);
			break;
		case WCC:
			job = new ConnectedComponentsJob(benchmarkConfig, vertexFilePath, edgeFilePath,
					graphDirected, benchmarkRun.getId(), logPath);
			break;
		case LCC:
			job = new LocalClusteringCoefficientJob(benchmarkConfig, vertexFilePath, edgeFilePath,
					graphDirected, benchmarkRun.getId(), logPath);
			break;
		case CDLP:
			job = new CommunityDetectionJob(benchmarkConfig, vertexFilePath, edgeFilePath,
					graphDirected, (CommunityDetectionLPParameters) params, benchmarkRun.getId(), logPath);
			break;
		case PR:
			job = new PageRankJob(benchmarkConfig, vertexFilePath, edgeFilePath,
					graphDirected, (PageRankParameters) params, benchmarkRun.getId(), logPath);
			break;
		case SSSP:
			job = new SingleSourceShortestPathsJob(benchmarkConfig, vertexFilePath, edgeFilePath,
					graphDirected, (SingleSourceShortestPathsParameters) params, benchmarkRun.getId(), logPath);
			break;
		default:
			throw new PlatformExecutionException("Unsupported algorithm");
	}

	if (benchmarkRunSetup.isOutputRequired()) {
		Path outputFile = benchmarkRunSetup.getOutputDir().resolve(benchmarkRun.getName());
		job.setOutputFile(outputFile.toFile());
	}

	try {
		job.run();
	} catch (IOException|InterruptedException e) {
		throw new PlatformExecutionException("failed to execute command", e);
	}

}
 
开发者ID:atlarge-research,项目名称:graphalytics-platforms-powergraph,代码行数:58,代码来源:PowergraphPlatform.java


注:本文中的science.atlarge.graphalytics.execution.RuntimeSetup类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。