use of org.batfish.common.plugin.DataPlanePlugin.ComputeDataPlaneResult in project batfish by batfish.
the class Batfish method computeDataPlane.
@Override
public DataPlaneAnswerElement computeDataPlane(boolean differentialContext) {
checkEnvironmentExists();
ComputeDataPlaneResult result = getDataPlanePlugin().computeDataPlane(differentialContext);
saveDataPlane(result._dataPlane, result._answerElement, false);
return result._answerElement;
}
use of org.batfish.common.plugin.DataPlanePlugin.ComputeDataPlaneResult in project batfish by batfish.
the class Batfish method computeCompressedDataPlane.
private CompressDataPlaneResult computeCompressedDataPlane(HeaderSpace headerSpace) {
// Since compression mutates the configurations, we must clone them before that happens.
// A simple way to do this is to create a deep clone of each entry using Java serialization.
_logger.info("Computing compressed dataplane");
Map<String, Configuration> clonedConfigs = loadConfigurations().entrySet().parallelStream().collect(toMap(Entry::getKey, entry -> SerializationUtils.clone(entry.getValue())));
Map<String, Configuration> configs = new BatfishCompressor(this, clonedConfigs).compress(headerSpace);
Topology topo = CommonUtil.synthesizeTopology(configs);
DataPlanePlugin dataPlanePlugin = getDataPlanePlugin();
ComputeDataPlaneResult result = dataPlanePlugin.computeDataPlane(false, configs, topo);
_storage.storeCompressedConfigurations(configs, _testrigSettings.getName());
return new CompressDataPlaneResult(configs, result._dataPlane, result._answerElement);
}
Aggregations