org.apache.hadoop.hdfs.server.protocol
Class NamenodeRegistration

java.lang.Object
  extended by org.apache.hadoop.hdfs.server.common.StorageInfo
      extended by org.apache.hadoop.hdfs.server.protocol.NamenodeRegistration
All Implemented Interfaces:
NodeRegistration, org.apache.hadoop.io.Writable

@InterfaceAudience.Private
@InterfaceStability.Evolving
public class NamenodeRegistration
extends StorageInfo
implements NodeRegistration

Information sent by a subordinate name-node to the active name-node during the registration process.


Field Summary
 
Fields inherited from class org.apache.hadoop.hdfs.server.common.StorageInfo
cTime, layoutVersion, namespaceID
 
Constructor Summary
NamenodeRegistration()
           
NamenodeRegistration(String address, String httpAddress, StorageInfo storageInfo, HdfsConstants.NamenodeRole role, long checkpointTime)
           
 
Method Summary
 String getAddress()
          Get address of the server node.
 long getCheckpointTime()
          Get the age of the image.
 String getRegistrationID()
          Get registration ID of the server node.
 HdfsConstants.NamenodeRole getRole()
          Get name-node role.
 int getVersion()
          Get layout version of the server node.
 boolean isRole(HdfsConstants.NamenodeRole that)
           
 void readFields(DataInput in)
           
 String toString()
           
 void write(DataOutput out)
           
 
Methods inherited from class org.apache.hadoop.hdfs.server.common.StorageInfo
getCTime, getLayoutVersion, getNamespaceID, setStorageInfo
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NamenodeRegistration

public NamenodeRegistration()

NamenodeRegistration

public NamenodeRegistration(String address,
                            String httpAddress,
                            StorageInfo storageInfo,
                            HdfsConstants.NamenodeRole role,
                            long checkpointTime)
Method Detail

getAddress

public String getAddress()
Description copied from interface: NodeRegistration
Get address of the server node.

Specified by:
getAddress in interface NodeRegistration
Returns:
hostname:portNumber

getRegistrationID

public String getRegistrationID()
Description copied from interface: NodeRegistration
Get registration ID of the server node.

Specified by:
getRegistrationID in interface NodeRegistration

getVersion

public int getVersion()
Description copied from interface: NodeRegistration
Get layout version of the server node.

Specified by:
getVersion in interface NodeRegistration

toString

public String toString()
Specified by:
toString in interface NodeRegistration
Overrides:
toString in class Object

getRole

public HdfsConstants.NamenodeRole getRole()
Get name-node role.


isRole

public boolean isRole(HdfsConstants.NamenodeRole that)

getCheckpointTime

public long getCheckpointTime()
Get the age of the image.


write

public void write(DataOutput out)
           throws IOException
Specified by:
write in interface org.apache.hadoop.io.Writable
Overrides:
write in class StorageInfo
Throws:
IOException

readFields

public void readFields(DataInput in)
                throws IOException
Specified by:
readFields in interface org.apache.hadoop.io.Writable
Overrides:
readFields in class StorageInfo
Throws:
IOException


Copyright © 2009 The Apache Software Foundation