|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.hadoop.hdfs.server.common.StorageInfo
org.apache.hadoop.hdfs.server.common.Storage
org.apache.hadoop.hdfs.server.namenode.FSImage
@InterfaceAudience.Private @InterfaceStability.Evolving public class FSImage
FSImage handles checkpointing and logging of the namespace edits.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.apache.hadoop.hdfs.server.common.Storage |
---|
Storage.StorageDirectory, Storage.StorageDirType, Storage.StorageState |
Field Summary | |
---|---|
protected long |
checkpointTime
|
protected org.apache.hadoop.hdfs.server.namenode.FSImage.CheckpointStates |
ckptState
Can fs-image be rolled? |
protected FSEditLog |
editLog
|
protected FSNamesystem |
namesystem
|
protected List<Storage.StorageDirectory> |
removedStorageDirs
list of failed (and thus removed) storages |
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 | |
---|---|
FSImage(StorageInfo storageInfo)
|
Method Summary | |
---|---|
protected void |
corruptPreUpgradeStorage(File rootDir)
|
void |
format()
|
FSEditLog |
getEditLog()
|
protected void |
getFields(Properties props,
Storage.StorageDirectory sd)
Get common storage fields. |
File |
getFsEditName()
|
protected FSNamesystem |
getFSNamesystem()
|
boolean |
getRestoreFailedStorage()
|
boolean |
isConversionNeeded(Storage.StorageDirectory sd)
|
protected void |
moveCurrent(Storage.StorageDirectory sd)
Move current to lastcheckpoint.tmp and
recreate empty current . |
protected void |
moveLastCheckpoint(Storage.StorageDirectory sd)
Move lastcheckpoint.tmp to previous.checkpoint |
static byte[] |
readBytes(DataInputStream in)
|
static String |
readString(DataInputStream in)
|
protected void |
saveCurrent(Storage.StorageDirectory sd)
Save current image and empty journal into current directory. |
protected void |
setFields(Properties props,
Storage.StorageDirectory sd)
Write last checkpoint time and version file into the storage directory. |
void |
setRestoreFailedStorage(boolean val)
|
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 |
Field Detail |
---|
protected FSNamesystem namesystem
protected long checkpointTime
protected FSEditLog editLog
protected List<Storage.StorageDirectory> removedStorageDirs
protected volatile org.apache.hadoop.hdfs.server.namenode.FSImage.CheckpointStates ckptState
Constructor Detail |
---|
public FSImage(StorageInfo storageInfo)
Method Detail |
---|
protected FSNamesystem getFSNamesystem()
public void setRestoreFailedStorage(boolean val)
public boolean getRestoreFailedStorage()
protected void getFields(Properties props, Storage.StorageDirectory sd) throws IOException
Storage
getFields
in class Storage
IOException
protected void setFields(Properties props, Storage.StorageDirectory sd) throws IOException
setFields
in class Storage
sd
- storage directory
IOException
public FSEditLog getEditLog()
public boolean isConversionNeeded(Storage.StorageDirectory sd) throws IOException
isConversionNeeded
in class Storage
IOException
protected void saveCurrent(Storage.StorageDirectory sd) throws IOException
current
directory.
IOException
protected void moveCurrent(Storage.StorageDirectory sd) throws IOException
current
to lastcheckpoint.tmp
and
recreate empty current
.
current
is moved only if it is well formatted,
that is contains VERSION file.
IOException
Storage.StorageDirectory.getLastCheckpointTmp()
,
Storage.StorageDirectory.getPreviousCheckpoint()
protected void moveLastCheckpoint(Storage.StorageDirectory sd) throws IOException
lastcheckpoint.tmp
to previous.checkpoint
IOException
Storage.StorageDirectory.getPreviousCheckpoint()
,
Storage.StorageDirectory.getLastCheckpointTmp()
public void format() throws IOException
IOException
public File getFsEditName() throws IOException
IOException
protected void corruptPreUpgradeStorage(File rootDir) throws IOException
corruptPreUpgradeStorage
in class Storage
IOException
public static String readString(DataInputStream in) throws IOException
IOException
public static byte[] readBytes(DataInputStream in) throws IOException
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |