@Override protected Integer featureValueOf(AbstractRoute actual) { return actual.getAdministrativeCost(); } }
.setNextHop( computeNextHopNode(route.getNextHopIp(), ipOwners)) .setAdminDistance(route.getAdministrativeCost()) .setMetric(route.getMetric()) .setTag(route.getTag())
/** * 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(); }