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


Java PlatformExecutionException类代码示例

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


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

示例1: deleteGraph

import science.atlarge.graphalytics.execution.PlatformExecutionException; //导入依赖的package包/类
@Override
public void deleteGraph(LoadedGraph loadedGraph) throws Exception {
	LOG.info("Unloading graph " + loadedGraph.getFormattedGraph().getName());
	try {

		int exitCode = loader.unload(loadedGraph.getLoadedPath());
		if (exitCode != 0) {
			throw new PlatformExecutionException("${platform-name} exited with an error code: " + exitCode);
		}
	} catch (Exception e) {
		throw new PlatformExecutionException("Failed to unload a ${platform-name} dataset.", e);
	}
	LOG.info("Unloaded graph " +  loadedGraph.getFormattedGraph().getName());
}
 
开发者ID:ldbc,项目名称:ldbc_graphalytics,代码行数:15,代码来源:__platform-name__Platform.java

示例2: run

import science.atlarge.graphalytics.execution.PlatformExecutionException; //导入依赖的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

示例3: run

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

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

	Algorithm algorithm = benchmarkRun.getAlgorithm();
	${platform-name}Configuration platformConfig = ${platform-name}Configuration.parsePropertiesFile();
	String inputPath = runtimeSetup.getLoadedGraph().getLoadedPath();
	String outputPath = benchmarkRunSetup.getOutputDir().resolve(benchmarkRun.getName()).toAbsolutePath().toString();

	${platform-name}Job job;
	switch (algorithm) {
		case BFS:
			job = new BreadthFirstSearchJob(runSpecification, platformConfig, inputPath, outputPath);
			break;
		case CDLP:
			job = new CommunityDetectionLPJob(runSpecification, platformConfig, inputPath, outputPath);
			break;
		case LCC:
			job = new LocalClusteringCoefficientJob(runSpecification, platformConfig, inputPath, outputPath);
			break;
		case PR:
			job = new PageRankJob(runSpecification, platformConfig, inputPath, outputPath);
			break;
		case WCC:
			job = new WeaklyConnectedComponentsJob(runSpecification, platformConfig, inputPath, outputPath);
			break;
		case SSSP:
			job = new SingleSourceShortestPathsJob(runSpecification, platformConfig, inputPath, outputPath);
			break;
		default:
			throw new PlatformExecutionException("Failed to load algorithm implementation.");
	}

	LOG.info("Executing benchmark with algorithm \"{}\" on graph \"{}\".",
			benchmarkRun.getAlgorithm().getName(),
			benchmarkRun.getFormattedGraph().getName());

	try {

		int exitCode = job.execute();
		if (exitCode != 0) {
			throw new PlatformExecutionException("${platform-name} exited with an error code: " + exitCode);
		}
	} catch (Exception e) {
		throw new PlatformExecutionException("Failed to execute a ${platform-name} job.", e);
	}

	LOG.info("Executed benchmark with algorithm \"{}\" on graph \"{}\".",
			benchmarkRun.getAlgorithm().getName(),
			benchmarkRun.getFormattedGraph().getName());

}
 
开发者ID:ldbc,项目名称:ldbc_graphalytics,代码行数:56,代码来源:__platform-name__Platform.java


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