public class FSImage extends Storage
Storage.StorageDirectory, Storage.StorageDirType, Storage.StorageState
限定符和类型 | 字段和说明 |
---|---|
protected long |
checkpointTime |
protected FSEditLog |
editLog |
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
cTime, layoutVersion, namespaceID
构造器和说明 |
---|
FSImage(File imageDir)
Represents an Image (image and edit file).
|
FSImage(StorageInfo storageInfo) |
限定符和类型 | 方法和说明 |
---|---|
protected void |
corruptPreUpgradeStorage(File rootDir) |
void |
format() |
FSEditLog |
getEditLog() |
protected void |
getFields(Properties props,
Storage.StorageDirectory sd)
Get common storage fields.
|
File |
getFsEditName() |
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. |
void |
setEditLog(FSEditLog newLog)
Testing hook
|
protected void |
setFields(Properties props,
Storage.StorageDirectory sd)
Write last checkpoint time and version file into the storage directory.
|
addStorageDir, checkVersionUpgradable, deleteDir, dirIterator, dirIterator, getNumStorageDirs, getRegistrationID, getStorageDir, is203LayoutVersion, isLockSupported, rename, unlockAll, writeAll, writeCorruptedData
getCTime, getLayoutVersion, getNamespaceID, setStorageInfo
protected long checkpointTime
protected FSEditLog editLog
public FSImage(StorageInfo storageInfo)
public FSImage(File imageDir) throws IOException
IOException
protected void getFields(Properties props, Storage.StorageDirectory sd) throws IOException
Storage
getFields
在类中 Storage
IOException
protected void setFields(Properties props, Storage.StorageDirectory sd) throws IOException
setFields
在类中 Storage
sd
- storage directoryIOException
public FSEditLog getEditLog()
public void setEditLog(FSEditLog newLog)
public boolean isConversionNeeded(Storage.StorageDirectory sd) throws IOException
isConversionNeeded
在类中 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.protected void moveLastCheckpoint(Storage.StorageDirectory sd) throws IOException
lastcheckpoint.tmp
to previous.checkpoint
public void format() throws IOException
IOException
public File getFsEditName() throws IOException
IOException
protected void corruptPreUpgradeStorage(File rootDir) throws IOException
corruptPreUpgradeStorage
在类中 Storage
IOException
public static String readString(DataInputStream in) throws IOException
IOException
public static byte[] readBytes(DataInputStream in) throws IOException
IOException
Copyright © 2009 The Apache Software Foundation