Search in sources :

Example 1 with ParseEnvironmentRoutingTableJob

use of org.batfish.job.ParseEnvironmentRoutingTableJob in project batfish by batfish.

the class Batfish method parseEnvironmentRoutingTables.

private SortedMap<String, RoutesByVrf> parseEnvironmentRoutingTables(SortedMap<Path, String> inputData, ParseEnvironmentRoutingTablesAnswerElement answerElement) {
    _logger.info("\n*** PARSING ENVIRONMENT ROUTING TABLES ***\n");
    _logger.resetTimer();
    SortedMap<String, RoutesByVrf> routingTables = new TreeMap<>();
    List<ParseEnvironmentRoutingTableJob> jobs = new ArrayList<>();
    SortedMap<String, Configuration> configurations = loadConfigurations();
    for (Entry<Path, String> routingFile : inputData.entrySet()) {
        Path currentFile = routingFile.getKey();
        String fileText = routingFile.getValue();
        String hostname = currentFile.getFileName().toString();
        if (!configurations.containsKey(hostname)) {
            continue;
        }
        Warnings warnings = buildWarnings(_settings);
        ParseEnvironmentRoutingTableJob job = new ParseEnvironmentRoutingTableJob(_settings, fileText, currentFile, warnings, this);
        jobs.add(job);
    }
    BatfishJobExecutor.runJobsInExecutor(_settings, _logger, jobs, routingTables, answerElement, _settings.getHaltOnParseError(), "Parse environment routing tables");
    _logger.printElapsedTime();
    return routingTables;
}
Also used : Path(java.nio.file.Path) ParseEnvironmentRoutingTableJob(org.batfish.job.ParseEnvironmentRoutingTableJob) HostConfiguration(org.batfish.representation.host.HostConfiguration) Configuration(org.batfish.datamodel.Configuration) ImmutableConfiguration(org.apache.commons.configuration2.ImmutableConfiguration) AwsConfiguration(org.batfish.representation.aws.AwsConfiguration) IptablesVendorConfiguration(org.batfish.representation.iptables.IptablesVendorConfiguration) VendorConfiguration(org.batfish.vendor.VendorConfiguration) ArrayList(java.util.ArrayList) RoutesByVrf(org.batfish.datamodel.collections.RoutesByVrf) TreeMap(java.util.TreeMap) Warnings(org.batfish.common.Warnings)

Aggregations

Path (java.nio.file.Path)1 ArrayList (java.util.ArrayList)1 TreeMap (java.util.TreeMap)1 ImmutableConfiguration (org.apache.commons.configuration2.ImmutableConfiguration)1 Warnings (org.batfish.common.Warnings)1 Configuration (org.batfish.datamodel.Configuration)1 RoutesByVrf (org.batfish.datamodel.collections.RoutesByVrf)1 ParseEnvironmentRoutingTableJob (org.batfish.job.ParseEnvironmentRoutingTableJob)1 AwsConfiguration (org.batfish.representation.aws.AwsConfiguration)1 HostConfiguration (org.batfish.representation.host.HostConfiguration)1 IptablesVendorConfiguration (org.batfish.representation.iptables.IptablesVendorConfiguration)1 VendorConfiguration (org.batfish.vendor.VendorConfiguration)1