org.apache.hadoop.hdfs.server.datanode
Class DataStorage

java.lang.Object
  extended by org.apache.hadoop.hdfs.server.common.StorageInfo
      extended by org.apache.hadoop.hdfs.server.common.Storage
          extended by org.apache.hadoop.hdfs.server.datanode.DataStorage
All Implemented Interfaces:
org.apache.hadoop.io.Writable

@InterfaceAudience.Private
public class DataStorage
extends Storage

Data storage information file.

See Also:
Storage

Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.hadoop.hdfs.server.common.Storage
Storage.StorageDirectory, Storage.StorageDirType, Storage.StorageState
 
Field Summary
 
Fields inherited from class org.apache.hadoop.hdfs.server.common.Storage
LAST_PRE_UPGRADE_LAYOUT_VERSION, LAST_UPGRADABLE_HADOOP_VERSION, LAST_UPGRADABLE_LAYOUT_VERSION, LOG, PRE_GENERATIONSTAMP_LAYOUT_VERSION, PRE_RBW_LAYOUT_VERSION, STORAGE_DIR_CURRENT, STORAGE_FILE_VERSION, storageDirs
 
Fields inherited from class org.apache.hadoop.hdfs.server.common.StorageInfo
cTime, layoutVersion, namespaceID
 
Constructor Summary
DataStorage(StorageInfo storageInfo, String strgID)
           
 
Method Summary
protected  void corruptPreUpgradeStorage(File rootDir)
           
protected  void getFields(Properties props, Storage.StorageDirectory sd)
          Get common storage fields.
 String getStorageID()
           
 boolean isConversionNeeded(Storage.StorageDirectory sd)
           
protected  void setFields(Properties props, Storage.StorageDirectory sd)
          Set common storage fields.
 
Methods inherited from class org.apache.hadoop.hdfs.server.common.Storage
addStorageDir, checkVersionUpgradable, deleteDir, dirIterator, dirIterator, getBuildVersion, getNumStorageDirs, getRegistrationID, getStorageDir, isLockSupported, listStorageDirectories, rename, unlockAll, writeAll, writeCorruptedData
 
Methods inherited from class org.apache.hadoop.hdfs.server.common.StorageInfo
getCTime, getLayoutVersion, getNamespaceID, readFields, setStorageInfo, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataStorage

public DataStorage(StorageInfo storageInfo,
                   String strgID)
Method Detail

getStorageID

public String getStorageID()

setFields

protected void setFields(Properties props,
                         Storage.StorageDirectory sd)
                  throws IOException
Description copied from class: Storage
Set common storage fields. Should be overloaded if additional fields need to be set.

Overrides:
setFields in class Storage
Throws:
IOException

getFields

protected void getFields(Properties props,
                         Storage.StorageDirectory sd)
                  throws IOException
Description copied from class: Storage
Get common storage fields. Should be overloaded if additional fields need to be get.

Overrides:
getFields in class Storage
Throws:
IOException

isConversionNeeded

public boolean isConversionNeeded(Storage.StorageDirectory sd)
                           throws IOException
Specified by:
isConversionNeeded in class Storage
Throws:
IOException

corruptPreUpgradeStorage

protected void corruptPreUpgradeStorage(File rootDir)
                                 throws IOException
Specified by:
corruptPreUpgradeStorage in class Storage
Throws:
IOException


Copyright © 2009 The Apache Software Foundation