Codota Logo
BatfishLogger.warnf
Code IndexAdd Codota 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)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Point p =
  • Codota Iconnew Point(x, y)
  • Codota Iconnew Point()
  • Codota IconMouseEvent e;e.getPoint()
  • Smart code suggestions by Codota
}
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

  • Creating JSON documents from java classes using gson
  • scheduleAtFixedRate (ScheduledExecutorService)
  • setRequestProperty (URLConnection)
    Sets the general request property. If a property with the key already exists, overwrite its value wi
  • putExtra (Intent)
  • BufferedImage (java.awt.image)
    The BufferedImage subclass describes an java.awt.Image with an accessible buffer of image data. All
  • NumberFormat (java.text)
    The abstract base class for all number formats. This class provides the interface for formatting and
  • Locale (java.util)
    A Locale object represents a specific geographical, political, or cultural region. An operation that
  • NoSuchElementException (java.util)
    Thrown when trying to retrieve an element past the end of an Enumeration or Iterator.
  • StringTokenizer (java.util)
    The string tokenizer class allows an application to break a string into tokens. The tokenization met
  • Pattern (java.util.regex)
    A compiled representation of a regular expression. A regular expression, specified as a string, must
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now