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, storageDirscTime, 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, writeCorruptedDatagetCTime, getLayoutVersion, getNamespaceID, setStorageInfoprotected long checkpointTime
protected FSEditLog editLog
public FSImage(StorageInfo storageInfo)
public FSImage(File imageDir) throws IOException
IOExceptionprotected void getFields(Properties props, Storage.StorageDirectory sd) throws IOException
StoragegetFields 在类中 StorageIOExceptionprotected void setFields(Properties props, Storage.StorageDirectory sd) throws IOException
setFields 在类中 Storagesd - storage directoryIOExceptionpublic FSEditLog getEditLog()
public void setEditLog(FSEditLog newLog)
public boolean isConversionNeeded(Storage.StorageDirectory sd) throws IOException
isConversionNeeded 在类中 StorageIOExceptionprotected void saveCurrent(Storage.StorageDirectory sd) throws IOException
current directory.IOExceptionprotected 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.checkpointpublic void format()
throws IOException
IOExceptionpublic File getFsEditName() throws IOException
IOExceptionprotected void corruptPreUpgradeStorage(File rootDir) throws IOException
corruptPreUpgradeStorage 在类中 StorageIOExceptionpublic static String readString(DataInputStream in) throws IOException
IOExceptionpublic static byte[] readBytes(DataInputStream in) throws IOException
IOExceptionCopyright © 2009 The Apache Software Foundation