|
||||||||||
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 org.apache.hadoop.io.MD5Hash |
imageDigest
|
protected FSNamesystem |
namesystem
|
protected org.apache.hadoop.io.MD5Hash |
newImageDigest
|
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, 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 | |
---|---|
FSImage(StorageInfo storageInfo)
|
Method Summary | |
---|---|
void |
format()
|
FSEditLog |
getEditLog()
|
protected void |
getFields(Properties props,
Storage.StorageDirectory sd)
Get common storage fields. |
File |
getFsEditName()
|
protected FSNamesystem |
getFSNamesystem()
|
boolean |
getRestoreFailedStorage()
|
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 |
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 |
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 |
setImageDigest(org.apache.hadoop.io.MD5Hash digest)
|
void |
setRestoreFailedStorage(boolean val)
|
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 |
Field Detail |
---|
protected FSNamesystem namesystem
protected long checkpointTime
protected FSEditLog editLog
protected org.apache.hadoop.io.MD5Hash imageDigest
protected org.apache.hadoop.io.MD5Hash newImageDigest
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 isPreUpgradableLayout(Storage.StorageDirectory sd) throws IOException
Storage
isPreUpgradableLayout
in class Storage
IOException
public void setImageDigest(org.apache.hadoop.io.MD5Hash digest)
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
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |