@InterfaceAudience.Private @InterfaceStability.Evolving public class FSImage extends Object implements Closeable
Modifier and Type | Field and Description |
---|---|
protected NNStorageRetentionManager |
archivalManager |
protected FSEditLog |
editLog |
protected long |
lastAppliedTxId
The last transaction ID that was either loaded from an image
or loaded by loading edits files.
|
static org.apache.commons.logging.Log |
LOG |
protected NNStorage |
storage |
Modifier | Constructor and Description |
---|---|
|
FSImage(Configuration conf)
Construct an FSImage
|
protected |
FSImage(Configuration conf,
Collection<URI> imageDirs,
List<URI> editsDirs)
Construct the FSImage.
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
String |
getBlockPoolID() |
String |
getClusterID() |
FSEditLog |
getEditLog() |
long |
getLastAppliedOrWrittenTxId() |
long |
getLastAppliedTxId() |
int |
getLayoutVersion() |
long |
getMostRecentCheckpointTxId() |
int |
getNamespaceID() |
NNStorage |
getStorage() |
void |
initEditLog() |
long |
loadEdits(Iterable<EditLogInputStream> editStreams,
FSNamesystem target,
MetaRecoveryContext recovery)
Load the specified list of edit files into the image.
|
void |
purgeOldStorage()
Purge any files in the storage directories that are no longer
necessary.
|
void |
saveDigestAndRenameCheckpointImage(long txid,
MD5Hash digest)
This is called by the 2NN after having downloaded an image, and by
the NN after having received a new image from the 2NN.
|
protected void |
saveFSImageInAllDirs(FSNamesystem source,
long txid) |
protected void |
saveFSImageInAllDirs(FSNamesystem source,
long txid,
Canceler canceler) |
void |
saveNamespace(FSNamesystem source) |
void |
saveNamespace(FSNamesystem source,
Canceler canceler)
Save the contents of the FS image to a new image file in each of the
current storage directories.
|
void |
updateLastAppliedTxIdFromWritten() |
public static final org.apache.commons.logging.Log LOG
protected FSEditLog editLog
protected NNStorage storage
protected long lastAppliedTxId
protected NNStorageRetentionManager archivalManager
public FSImage(Configuration conf) throws IOException
conf
- ConfigurationIOException
- if default directories are invalid.protected FSImage(Configuration conf, Collection<URI> imageDirs, List<URI> editsDirs) throws IOException
conf
- ConfigurationimageDirs
- Directories the image can be stored in.editsDirs
- Directories the editlog can be stored in.IOException
- if directories are invalid.public FSEditLog getEditLog()
public void initEditLog()
public long loadEdits(Iterable<EditLogInputStream> editStreams, FSNamesystem target, MetaRecoveryContext recovery) throws IOException
IOException
public void saveNamespace(FSNamesystem source) throws IOException
IOException
saveNamespace(FSNamesystem, Canceler)
public void saveNamespace(FSNamesystem source, Canceler canceler) throws IOException
canceler
- IOException
protected void saveFSImageInAllDirs(FSNamesystem source, long txid) throws IOException
IOException
saveFSImageInAllDirs(FSNamesystem, long, Canceler)
protected void saveFSImageInAllDirs(FSNamesystem source, long txid, Canceler canceler) throws IOException
IOException
public void purgeOldStorage()
public void saveDigestAndRenameCheckpointImage(long txid, MD5Hash digest) throws IOException
IOException
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
public NNStorage getStorage()
public int getLayoutVersion()
public int getNamespaceID()
public String getClusterID()
public String getBlockPoolID()
public long getLastAppliedTxId()
public long getLastAppliedOrWrittenTxId()
public void updateLastAppliedTxIdFromWritten()
public long getMostRecentCheckpointTxId()
Copyright © 2013 Apache Software Foundation. All rights reserved.