@Private public class BlockPoolSliceStorage extends Storage
StorageStorage.FormatConfirmable, Storage.StorageDirectory, Storage.StorageDirType, Storage.StorageStateLAST_PRE_UPGRADE_LAYOUT_VERSION, LAST_UPGRADABLE_HADOOP_VERSION, LAST_UPGRADABLE_LAYOUT_VERSION, LAYOUT_VERSIONS_203, LOG, STORAGE_1_BBW, STORAGE_DIR_CURRENT, STORAGE_DIR_PREVIOUS, STORAGE_FILE_LOCK, STORAGE_PREVIOUS_CKPT, STORAGE_TMP_FINALIZED, STORAGE_TMP_LAST_CKPT, STORAGE_TMP_PREVIOUS, STORAGE_TMP_REMOVEDclusterID, cTime, layoutVersion, namespaceID, STORAGE_FILE_VERSION, storageType| Constructor | Description |
|---|---|
BlockPoolSliceStorage(StorageInfo storageInfo,
java.lang.String bpid) |
| Modifier and Type | Method | Description |
|---|---|---|
void |
addStorageDir(Storage.StorageDirectory sd) |
|
void |
clearRollingUpgradeMarkers(java.util.List<Storage.StorageDirectory> dnStorageDirs) |
Check whether the rolling upgrade marker file exists for each BP storage
root.
|
void |
clearTrash() |
Delete all files and directories in the trash directories.
|
static java.io.File |
getBpRoot(java.lang.String bpID,
java.io.File dnCurDir) |
Get a block pool storage root based on data node storage root
|
java.lang.String |
getTrashDirectory(ReplicaInfo info) |
Get a target subdirectory under trash/ for a given block file that is being
deleted.
|
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.
|
boolean |
isTrashAllowed(java.io.File blockFile) |
Determine whether we can use trash for the given blockFile.
|
protected void |
setFieldsFromProperties(java.util.Properties props,
Storage.StorageDirectory sd) |
Get common storage fields.
|
protected void |
setPropertiesFromFields(java.util.Properties props,
Storage.StorageDirectory sd) |
Set layoutVersion, namespaceID and blockpoolID into block pool storage
VERSION file
|
void |
setRollingUpgradeMarkers(java.util.List<Storage.StorageDirectory> dnStorageDirs) |
Create a rolling upgrade marker file for each BP storage root, if it
does not exist already.
|
void |
stopTrashCleaner() |
|
java.lang.String |
toString() |
|
boolean |
trashEnabled() |
trash is enabled if at least one storage directory contains trash root
|
checkVersionUpgradable, confirmFormat, containsStorageDir, containsStorageDir, containsStorageDir, deleteDir, dirIterable, dirIterator, dirIterator, dirIterator, dirIterator, getBuildVersion, getFiles, getNamespaceInfo, getNumStorageDirs, getRegistrationID, getSingularStorageDir, getStorageDir, getStorageDirs, is203LayoutVersion, listStorageDirectories, nativeCopyFileUnbuffered, rename, unlockAll, writeAll, writeProperties, writeProperties, writePropertiescheckStorageType, getClusterID, getClusterIdFromColonSeparatedString, getCTime, getLayoutVersion, getNamespaceID, getNsIdFromColonSeparatedString, getProperty, getServiceLayoutFeatureMap, getServiceLayoutVersion, readPreviousVersionProperties, readProperties, readPropertiesFile, setClusterId, setcTime, setLayoutVersion, setNamespaceID, setServiceLayoutVersion, setStorageInfo, toColonSeparatedString, toMapString, versionSupportsFederationpublic BlockPoolSliceStorage(StorageInfo storageInfo, java.lang.String bpid)
public void addStorageDir(Storage.StorageDirectory sd)
addStorageDir in class Storageprotected void setPropertiesFromFields(java.util.Properties props,
Storage.StorageDirectory sd)
throws java.io.IOException
setPropertiesFromFields in class Storageprops - the Properties object to write intojava.io.IOExceptionprotected void setFieldsFromProperties(java.util.Properties props,
Storage.StorageDirectory sd)
throws java.io.IOException
StorageInfosetFieldsFromProperties in class StorageInfoprops - propertiesjava.io.IOException - on errorpublic java.lang.String toString()
toString in class StorageInfopublic static java.io.File getBpRoot(java.lang.String bpID,
java.io.File dnCurDir)
bpID - block pool IDdnCurDir - data node storage root directorypublic boolean isPreUpgradableLayout(Storage.StorageDirectory sd) throws java.io.IOException
StorageisPreUpgradableLayout in class Storagejava.io.IOException@VisibleForTesting public boolean isTrashAllowed(java.io.File blockFile)
public java.lang.String getTrashDirectory(ReplicaInfo info)
public void clearTrash()
public void stopTrashCleaner()
@VisibleForTesting public boolean trashEnabled()
public void setRollingUpgradeMarkers(java.util.List<Storage.StorageDirectory> dnStorageDirs) throws java.io.IOException
dnStorageDirs - java.io.IOExceptionpublic void clearRollingUpgradeMarkers(java.util.List<Storage.StorageDirectory> dnStorageDirs) throws java.io.IOException
dnStorageDirs - java.io.IOExceptionCopyright © 2008–2025 Apache Software Foundation. All rights reserved.