Class ReverseZoneUtils

java.lang.Object
org.apache.hadoop.registry.server.dns.ReverseZoneUtils

public final class ReverseZoneUtils extends Object
Utilities for configuring reverse zones.
  • Method Details

    • getReverseZoneNetworkAddress

      protected static String getReverseZoneNetworkAddress(String baseIp, int range, int index) throws UnknownHostException
      Given a baseIp, range and index, return the network address for the reverse zone.
      Parameters:
      baseIp - base ip address to perform calculations against.
      range - number of ip addresses per subnet.
      index - the index of the subnet to calculate.
      Returns:
      the calculated ip address.
      Throws:
      UnknownHostException - if an invalid ip is provided.
    • getSubnetCountForReverseZones

      protected static long getSubnetCountForReverseZones(org.apache.hadoop.conf.Configuration conf)
      When splitting the reverse zone, return the number of subnets needed, given the range and netmask.
      Parameters:
      conf - the Hadoop configuration.
      Returns:
      The number of subnets given the range and netmask.
    • splitIp

      @VisibleForTesting protected static long[] splitIp(String baseIp) throws UnknownHostException
      Throws:
      UnknownHostException