DistributedSecurityAnalysisExecution
, which clarifies the input data for that kind
of execution, and tries to differentiate more between a SecurityAnalysis
and its mode of execution.@Deprecated public class DistributedSecurityAnalysis extends ExternalSecurityAnalysis
computationManager, config, extensions, network, taskCount
Constructor and Description |
---|
DistributedSecurityAnalysis(ExternalSecurityAnalysisConfig config,
Network network,
com.powsybl.computation.ComputationManager computationManager,
List<String> extensions,
int taskCount)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
CompletableFuture<SecurityAnalysisResult> |
run(String workingVariantId,
SecurityAnalysisParameters parameters,
ContingenciesProvider contingenciesProvider)
Deprecated.
|
CompletableFuture<SecurityAnalysisResultWithLog> |
runWithLog(String workingVariantId,
SecurityAnalysisParameters parameters,
ContingenciesProvider contingenciesProvider)
Deprecated.
To be consistent with
SecurityAnalysis.run(String, SecurityAnalysisParameters, ContingenciesProvider) , this method would also complete exceptionally
if there are exceptions thrown. |
addInterceptor, buildInput, removeInterceptor
public DistributedSecurityAnalysis(ExternalSecurityAnalysisConfig config, Network network, com.powsybl.computation.ComputationManager computationManager, List<String> extensions, int taskCount)
public CompletableFuture<SecurityAnalysisResult> run(String workingVariantId, SecurityAnalysisParameters parameters, ContingenciesProvider contingenciesProvider)
run
in interface SecurityAnalysis
run
in class ExternalSecurityAnalysis
public CompletableFuture<SecurityAnalysisResultWithLog> runWithLog(String workingVariantId, SecurityAnalysisParameters parameters, ContingenciesProvider contingenciesProvider)
SecurityAnalysis
SecurityAnalysis.run(String, SecurityAnalysisParameters, ContingenciesProvider)
, this method would also complete exceptionally
if there are exceptions thrown. But the original exception would be wrapped in ComputationException
, and those .out/.err log file's contents
are be collected in the ComputationException
too.
try {
SecurityAnalysisResultWithLog resultWithLog = securityAnalysis.runWithLog(currentState, parameters, contingenciesProvider).join();
result = resultWithLog.getResult();
} catch (CompletionException e) {
if (e.getCause() instanceof ComputationException) {
ComputationException computationException = (ComputationException) e.getCause();
System.out.println("Consume exception...");
computationException.getOutLogs().forEach((name, content) -> {
System.out.println("-----" + name + "----");
System.out.println(content);
});
computationException.getErrLogs().forEach((name, content) -> {
System.out.println("-----" + name + "----");
System.out.println(content);
});
}
throw e;
}
Copyright © 2020. All rights reserved.