本文整理汇总了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());
}
示例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);
}
}
示例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());
}