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, LAYOUT_VERSIONS_203, LOG, PRE_GENERATIONSTAMP_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 getFields(Properties props, Storage.StorageDirectory sd)
          Get common storage fields.
 String getStorageID()
           
 boolean isPreUpgradableLayout(Storage.StorageDirectory sd)
          Return true if the layout of the given storage directory is from a version of Hadoop prior to the introduction of the "current" and "previous" directories which allow upgrade and rollback.
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, is203LayoutVersion, isLockSupported, listStorageDirectories, rename, unlockAll, writeAll
 
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

isPreUpgradableLayout

public boolean isPreUpgradableLayout(Storage.StorageDirectory sd)
                              throws IOException
Description copied from class: Storage
Return true if the layout of the given storage directory is from a version of Hadoop prior to the introduction of the "current" and "previous" directories which allow upgrade and rollback.

Specified by:
isPreUpgradableLayout in class Storage
Throws:
IOException


Copyright © 2009 The Apache Software Foundation