Class BaseServiceRecordProcessor

java.lang.Object
org.apache.hadoop.registry.server.dns.BaseServiceRecordProcessor
All Implemented Interfaces:
ServiceRecordProcessor
Direct Known Subclasses:
ApplicationServiceRecordProcessor, ContainerServiceRecordProcessor

public abstract class BaseServiceRecordProcessor extends Object implements ServiceRecordProcessor
Provides common service record processing logic.
  • Constructor Details

    • BaseServiceRecordProcessor

      public BaseServiceRecordProcessor(ServiceRecord record, String path, String domain, ZoneSelector zoneSelector) throws Exception
      Creates a service record processor.
      Parameters:
      record - the service record.
      path - the node path for the record in the registry.
      domain - the target DNS domain for the service record associated DNS records.
      zoneSelector - A selector of the best zone for a given DNS name.
      Throws:
      Exception - if an issue is generated during instantiation.
  • Method Details

    • reverseIP

      protected org.xbill.DNS.Name reverseIP(String ip) throws UnknownHostException
      Reverse the string representation of the input IP address.
      Parameters:
      ip - the string representation of the IP address.
      Returns:
      the reversed IP address.
      Throws:
      UnknownHostException - if the ip is unknown.
    • manageDNSRecords

      public void manageDNSRecords(org.apache.hadoop.registry.server.dns.RegistryDNS.RegistryCommand command) throws IOException
      Manages the creation and registration of service record generated DNS records.
      Specified by:
      manageDNSRecords in interface ServiceRecordProcessor
      Parameters:
      command - the DNS registration command object (e.g. add_record, remove record)
      Throws:
      IOException - if the creation or registration generates an issue.
    • registerRecordDescriptor

      protected void registerRecordDescriptor(int type, org.apache.hadoop.registry.server.dns.BaseServiceRecordProcessor.RecordDescriptor recordDescriptor)
      Add the DNS record descriptor object to the record type to descriptor mapping.
      Parameters:
      type - the DNS record type.
      recordDescriptor - the DNS record descriptor
    • registerRecordDescriptor

      protected void registerRecordDescriptor(int type, List<org.apache.hadoop.registry.server.dns.BaseServiceRecordProcessor.RecordDescriptor> recordDescriptors)
      Add the DNS record descriptor objects to the record type to descriptor mapping.
      Parameters:
      type - the DNS record type.
      recordDescriptors - the DNS record descriptors
    • getPath

      protected String getPath()
      Return the path associated with the record.
      Returns:
      the path.
    • setPath

      protected void setPath(String path)
      Set the path associated with the record.
      Parameters:
      path - the path.