Class BaseServiceRecordProcessor
java.lang.Object
org.apache.hadoop.registry.server.dns.BaseServiceRecordProcessor
- All Implemented Interfaces:
ServiceRecordProcessor
- Direct Known Subclasses:
ApplicationServiceRecordProcessor,ContainerServiceRecordProcessor
Provides common service record processing logic.
-
Constructor Summary
ConstructorsConstructorDescriptionBaseServiceRecordProcessor(ServiceRecord record, String path, String domain, ZoneSelector zoneSelector) Creates a service record processor. -
Method Summary
Modifier and TypeMethodDescriptionprotected StringgetPath()Return the path associated with the record.voidmanageDNSRecords(org.apache.hadoop.registry.server.dns.RegistryDNS.RegistryCommand command) Manages the creation and registration of service record generated DNS records.protected voidregisterRecordDescriptor(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.protected voidregisterRecordDescriptor(int type, org.apache.hadoop.registry.server.dns.BaseServiceRecordProcessor.RecordDescriptor recordDescriptor) Add the DNS record descriptor object to the record type to descriptor mapping.protected org.xbill.DNS.NameReverse the string representation of the input IP address.protected voidSet the path associated with the record.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.hadoop.registry.server.dns.ServiceRecordProcessor
getRecordTypes, initTypeToInfoMapping
-
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
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:
manageDNSRecordsin interfaceServiceRecordProcessor- 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
Return the path associated with the record.- Returns:
- the path.
-
setPath
Set the path associated with the record.- Parameters:
path- the path.
-