Tabnine Logo
BatfishLogger.warnf
Code IndexAdd Tabnine to your IDE (free)

How to use
warnf
method
in
org.batfish.common.BatfishLogger

Best Java code snippets using org.batfish.common.BatfishLogger.warnf (Showing top 12 results out of 315)

origin: batfish/batfish

private void saveSolverInput(Expr expr) {
 // synchronize to avoid z3 concurrency bugs.
 // use NodJob to synchronize with any other similar writers.
 synchronized (NodJob.class) {
  Path nodPath =
    _settings
      .getActiveTestrigSettings()
      .getBasePath()
      .resolve(
        String.format(
          "solverInput-%s-%d.smt2", Instant.now(), Thread.currentThread().getId()));
  try (FileWriter writer = new FileWriter(nodPath.toFile())) {
   writer.write(expr.toString());
  } catch (IOException e) {
   _logger.warnf("Error saving Nod program to file: %s", Throwables.getStackTraceAsString(e));
  }
 }
}
origin: batfish/batfish

private void saveNodProgram(NodProgram program) {
 // synchronize to avoid z3 concurrency bugs. TODO: is this really needed?
 // other writers also use NodJob.class to synchronize writes.
 synchronized (NodJob.class) {
  Path nodPath =
    _settings
      .getActiveTestrigSettings()
      .getBasePath()
      .resolve(
        String.format(
          "nodProgram-%s-%d.smt2", Instant.now(), Thread.currentThread().getId()));
  try (FileWriter writer = new FileWriter(nodPath.toFile())) {
   writer.write(program.toSmt2String());
  } catch (IOException e) {
   _logger.warnf("Error saving Nod program to file: %s", Throwables.getStackTraceAsString(e));
  }
 }
}
origin: batfish/batfish

@Override
public @Nullable SortedSet<Edge> loadEdgeBlacklist(NetworkId network, SnapshotId snapshot) {
 Path path =
   _d.getSnapshotDir(network, snapshot)
     .resolve(Paths.get(BfConsts.RELPATH_INPUT, BfConsts.RELPATH_EDGE_BLACKLIST_FILE));
 if (!Files.exists(path)) {
  return null;
 }
 String fileText = CommonUtil.readFile(path);
 try {
  return BatfishObjectMapper.mapper()
    .readValue(fileText, new TypeReference<SortedSet<Edge>>() {});
 } catch (IOException e) {
  _logger.warnf(
    "Unexpected exception caught while loading edge blacklist for snapshot %s: %s",
    snapshot, Throwables.getStackTraceAsString(e));
  return null;
 }
}
origin: batfish/batfish

@Override
public @Nullable SortedSet<String> loadNodeBlacklist(NetworkId network, SnapshotId snapshot) {
 Path path =
   _d.getSnapshotDir(network, snapshot)
     .resolve(Paths.get(BfConsts.RELPATH_INPUT, BfConsts.RELPATH_NODE_BLACKLIST_FILE));
 if (!Files.exists(path)) {
  return null;
 }
 String fileText = CommonUtil.readFile(path);
 try {
  return BatfishObjectMapper.mapper()
    .readValue(fileText, new TypeReference<SortedSet<String>>() {});
 } catch (IOException e) {
  _logger.warnf(
    "Unexpected exception caught while loading node blacklist for snapshot %s: %s",
    snapshot, Throwables.getStackTraceAsString(e));
  return null;
 }
}
origin: batfish/batfish

@Override
public @Nullable SortedSet<NodeInterfacePair> loadInterfaceBlacklist(
  NetworkId network, SnapshotId snapshot) {
 Path path =
   _d.getSnapshotDir(network, snapshot)
     .resolve(Paths.get(BfConsts.RELPATH_INPUT, BfConsts.RELPATH_INTERFACE_BLACKLIST_FILE));
 if (!Files.exists(path)) {
  return null;
 }
 String fileText = CommonUtil.readFile(path);
 try {
  return BatfishObjectMapper.mapper()
    .readValue(fileText, new TypeReference<SortedSet<NodeInterfacePair>>() {});
 } catch (IOException e) {
  _logger.warnf(
    "Unexpected exception caught while loading interface blacklist for snapshot %s: %s",
    snapshot, Throwables.getStackTraceAsString(e));
  return null;
 }
}
origin: batfish/batfish

@Override
public @Nullable Layer1Topology loadLayer1Topology(NetworkId network, SnapshotId snapshot) {
 Path path =
   _d.getSnapshotDir(network, snapshot)
     .resolve(Paths.get(BfConsts.RELPATH_INPUT, BfConsts.RELPATH_L1_TOPOLOGY_PATH));
 if (!Files.exists(path)) {
  // (deprecated)
  path =
    _d.getSnapshotDir(network, snapshot)
      .resolve(Paths.get(BfConsts.RELPATH_INPUT, "testrig_layer1_topology"));
 }
 if (!Files.exists(path)) {
  return null;
 }
 AtomicInteger counter = _newBatch.apply("Reading layer-1 topology", 1);
 String topologyFileText = CommonUtil.readFile(path);
 try {
  return BatfishObjectMapper.mapper().readValue(topologyFileText, Layer1Topology.class);
 } catch (IOException e) {
  _logger.warnf(
    "Unexpected exception caught while loading layer-1 topology for snapshot %s: %s",
    snapshot, Throwables.getStackTraceAsString(e));
  return null;
 } finally {
  counter.incrementAndGet();
 }
}
origin: batfish/batfish

private boolean cachedConfigsAreCompatible(NetworkId network, SnapshotId snapshot) {
 try {
  ConvertConfigurationAnswerElement ccae =
    loadConvertConfigurationAnswerElement(network, snapshot);
  return ccae != null
    && Version.isCompatibleVersion(
      FileBasedStorage.class.getCanonicalName(),
      "Old processed configurations",
      ccae.getVersion());
 } catch (BatfishException e) {
  _logger.warnf(
    "Unexpected exception caught while deserializing configs for snapshot %s: %s",
    snapshot, Throwables.getStackTraceAsString(e));
  return false;
 }
}
origin: batfish/batfish

@VisibleForTesting
static String readQuestionTemplate(Path file, Map<String, String> templates)
  throws JSONException, IOException {
 String questionText = CommonUtil.readFile(file);
 JSONObject questionObj = new JSONObject(questionText);
 if (questionObj.has(BfConsts.PROP_INSTANCE) && !questionObj.isNull(BfConsts.PROP_INSTANCE)) {
  JSONObject instanceDataObj = questionObj.getJSONObject(BfConsts.PROP_INSTANCE);
  String instanceDataStr = instanceDataObj.toString();
  InstanceData instanceData =
    BatfishObjectMapper.mapper().readValue(instanceDataStr, InstanceData.class);
  String name = instanceData.getInstanceName();
  String key = name.toLowerCase();
  if (templates.containsKey(key) && _logger != null) {
   _logger.warnf(
     "Found duplicate template having instance name %s, only the last one in the list of templatedirs will be loaded\n",
     name);
  }
  templates.put(key, questionText);
  return name;
 } else {
  throw new BatfishException(String.format("Question in file:%s has no instance name", file));
 }
}
origin: batfish/batfish

_logger.warnf(
  "WARNING: Unsupported switch port mode %s, assuming no VLANs allowed: \"%s:%s\"\n",
  iface.getSwitchportMode(), hostname, iface.getName());
 Interface iface = vlanInterfaces.get(vlanNumber);
 if ((iface != null) && iface.getAutoState()) {
  _logger.warnf(
    "WARNING: Disabling unusable vlan interface because no switch port is assigned "
      + "to it: \"%s:%d\"\n",
origin: batfish/batfish

private void updateSnapshotNodeRoles() {
 // Compute new auto role data and updates existing auto data with it
 NetworkId networkId = _settings.getContainer();
 SnapshotId snapshotId = _settings.getTestrig();
 NodeRolesId snapshotNodeRolesId = _idResolver.getSnapshotNodeRolesId(networkId, snapshotId);
 Set<String> nodeNames = loadConfigurations().keySet();
 Topology rawLayer3Topology = _topologyProvider.getRawLayer3Topology(getNetworkSnapshot());
 SortedSet<NodeRoleDimension> autoRoles =
   new InferRoles(nodeNames, rawLayer3Topology).inferRoles();
 NodeRolesData.Builder snapshotNodeRoles = NodeRolesData.builder();
 try {
  if (!autoRoles.isEmpty()) {
   snapshotNodeRoles.setDefaultDimension(autoRoles.first().getName());
   snapshotNodeRoles.setRoleDimensions(autoRoles);
  }
  _storage.storeNodeRoles(snapshotNodeRoles.build(), snapshotNodeRolesId);
 } catch (IOException e) {
  _logger.warnf("Could not update node roles: %s", e);
 }
}
origin: batfish/batfish

 answerStringToPrint = answer.prettyPrint();
} catch (IOException e) {
 _logger.warnf(
   "Using Json for pretty printing because could not deserialize response as %s: %s",
   Answer.class.getSimpleName(), e.getMessage());
origin: batfish/batfish

_logger.warnf(
  "Error listing snapshot %s in network %s: %s",
  networkName, snapshot, Throwables.getStackTraceAsString(e));
org.batfish.commonBatfishLoggerwarnf

Popular methods of BatfishLogger

  • <init>
  • debugf
  • errorf
  • info
  • error
  • infof
  • debug
  • getLogLevel
  • getLogLevelStr
  • output
  • append
  • getHistory
  • append,
  • getHistory,
  • isActive,
  • setLogLevel,
  • warn,
  • close,
  • getElapsedTime,
  • getPrintStream,
  • getRotatedLogFilename

Popular in Java

  • Making http requests using okhttp
  • runOnUiThread (Activity)
  • getResourceAsStream (ClassLoader)
  • getSystemService (Context)
  • GridLayout (java.awt)
    The GridLayout class is a layout manager that lays out a container's components in a rectangular gri
  • StringTokenizer (java.util)
    Breaks a string into tokens; new code should probably use String#split.> // Legacy code: StringTo
  • BlockingQueue (java.util.concurrent)
    A java.util.Queue that additionally supports operations that wait for the queue to become non-empty
  • JLabel (javax.swing)
  • Get (org.apache.hadoop.hbase.client)
    Used to perform Get operations on a single row. To get everything for a row, instantiate a Get objec
  • Join (org.hibernate.mapping)
  • From CI to AI: The AI layer in your organization
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now