Tabnine Logo
AbstractRoute.getMetric
Code IndexAdd Tabnine to your IDE (free)

How to use
getMetric
method
in
org.batfish.datamodel.AbstractRoute

Best Java code snippets using org.batfish.datamodel.AbstractRoute.getMetric (Showing top 9 results out of 315)

origin: batfish/batfish

 @Override
 protected Long featureValueOf(AbstractRoute actual) {
  return actual.getMetric();
 }
}
origin: batfish/batfish

@Override
public long evaluate(Environment environment) {
 long oldMetric = environment.getOriginalRoute().getMetric();
 long newVal = oldMetric - _subtrahend;
 return newVal;
}
origin: batfish/batfish

@Override
public long evaluate(Environment environment) {
 long oldMetric = environment.getOriginalRoute().getMetric();
 long newVal = oldMetric + _addend;
 return newVal;
}
origin: batfish/batfish

@Override
public long evaluate(Environment environment) {
 return environment.getOriginalRoute().getMetric();
}
origin: batfish/batfish

 /**
  * Attempt to calculate the cost to reach given routes next hop IP.
  *
  * @param route bgp route
  * @return if next hop IP matches a route we have, returns the metric for that route; otherwise
  *     {@link Long#MAX_VALUE}
  */
 private long getIgpCostToNextHopIp(BgpRoute route) {
  if (_mainRib == null) {
   return Long.MAX_VALUE;
  }
  Set<AbstractRoute> s = _mainRib.longestPrefixMatch(route.getNextHopIp());
  return s == null || s.isEmpty() ? Long.MAX_VALUE : s.iterator().next().getMetric();
 }
}
origin: batfish/batfish

  computeNextHopNode(route.getNextHopIp(), ipOwners))
.setAdminDistance(route.getAdministrativeCost())
.setMetric(route.getMetric())
.setTag(route.getTag())
.build()));
origin: batfish/batfish

/**
 * Converts a {@link AbstractRoute} to a {@link Row}
 *
 * @param hostName {@link String} host-name of the node containing the route
 * @param vrfName {@link String} name of the VRF containing the route
 * @param abstractRoute {@link AbstractRoute} to convert
 * @param columnMetadataMap Column metadata of the columns for this {@link Row} c
 * @return {@link Row} representing the {@link AbstractRoute}
 */
private static Row abstractRouteToRow(
  String hostName,
  String vrfName,
  AbstractRoute abstractRoute,
  Map<String, ColumnMetadata> columnMetadataMap,
  @Nullable Map<Ip, Set<String>> ipOwners) {
 return Row.builder(columnMetadataMap)
   .put(COL_NODE, new Node(hostName))
   .put(COL_VRF_NAME, vrfName)
   .put(COL_NETWORK, abstractRoute.getNetwork())
   .put(COL_NEXT_HOP_IP, abstractRoute.getNextHopIp())
   .put(COL_NEXT_HOP, computeNextHopNode(abstractRoute.getNextHopIp(), ipOwners))
   .put(COL_PROTOCOL, abstractRoute.getProtocol())
   .put(
     COL_TAG, abstractRoute.getTag() == AbstractRoute.NO_TAG ? null : abstractRoute.getTag())
   .put(COL_ADMIN_DISTANCE, abstractRoute.getAdministrativeCost())
   .put(COL_METRIC, abstractRoute.getMetric())
   .build();
}
origin: batfish/batfish

transformedOutgoingRouteBuilder.setMetric(route.getMetric());
origin: batfish/batfish

environment.setIntermediateBgpAttributes(ir);
AbstractRoute or = environment.getOriginalRoute();
ir.setMetric(or.getMetric());
ir.setTag(or.getTag());
org.batfish.datamodelAbstractRoutegetMetric

Popular methods of AbstractRoute

  • getNetwork
    IPV4 network of this route
  • getNextHopIp
    Next hop IP for this route. If not known, Route#UNSET_ROUTE_NEXT_HOP_IP must be returned.
  • getProtocol
  • getNextHopInterface
    Name of the next-hop interface for this route. If not known, Route#UNSET_NEXT_HOP_INTERFACE must be
  • getNonForwarding
    Returns true if this route is non-forwarding, i.e., it can be installed in the main RIB but not the
  • getTag
    Return the route's tag or #NO_TAG if no tag is present
  • getAdministrativeCost
  • getNonRouting
    Check if this route is "non-routing", i.e., should not be installed in the main RIB.
  • toBuilder
    Return a AbstractRouteBuilder pre-populated with the values for this route.

Popular in Java

  • Reading from database using SQL prepared statement
  • notifyDataSetChanged (ArrayAdapter)
  • scheduleAtFixedRate (Timer)
  • compareTo (BigDecimal)
  • UnknownHostException (java.net)
    Thrown when a hostname can not be resolved.
  • Permission (java.security)
    Legacy security code; do not use.
  • Deque (java.util)
    A linear collection that supports element insertion and removal at both ends. The name deque is shor
  • Random (java.util)
    This class provides methods that return pseudo-random values.It is dangerous to seed Random with the
  • JFileChooser (javax.swing)
  • JTextField (javax.swing)
  • Top 17 Free Sublime Text Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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