org.apache.hadoop.hdfs.server.common
Class StorageInfo

java.lang.Object
  extended by org.apache.hadoop.hdfs.server.common.StorageInfo
All Implemented Interfaces:
org.apache.hadoop.io.Writable
Direct Known Subclasses:
CheckpointSignature, NamenodeRegistration, NamespaceInfo, Storage

@InterfaceAudience.Private
public class StorageInfo
extends Object
implements org.apache.hadoop.io.Writable

Common class for storage information. TODO namespaceID should be long and computed as hash(address + port)


Field Summary
 long cTime
           
 int layoutVersion
           
 int namespaceID
           
 
Constructor Summary
StorageInfo()
           
StorageInfo(int layoutV, int nsID, long cT)
           
StorageInfo(StorageInfo from)
           
 
Method Summary
 long getCTime()
          Creation time of the file system state.
 int getLayoutVersion()
          Layout version of the storage data.
 int getNamespaceID()
          Namespace id of the file system.
 void readFields(DataInput in)
           
 void setStorageInfo(StorageInfo from)
           
 void write(DataOutput out)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

layoutVersion

public int layoutVersion

namespaceID

public int namespaceID

cTime

public long cTime
Constructor Detail

StorageInfo

public StorageInfo()

StorageInfo

public StorageInfo(int layoutV,
                   int nsID,
                   long cT)

StorageInfo

public StorageInfo(StorageInfo from)
Method Detail

getLayoutVersion

public int getLayoutVersion()
Layout version of the storage data.


getNamespaceID

public int getNamespaceID()
Namespace id of the file system.

Assigned to the file system at formatting and never changes after that. Shared by all file system components.


getCTime

public long getCTime()
Creation time of the file system state.

Modified during upgrades.


setStorageInfo

public void setStorageInfo(StorageInfo from)

write

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

readFields

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


Copyright © 2009 The Apache Software Foundation