| Modifier and Type | Class | Description |
|---|---|---|
static class |
DataStorage.VolumeBuilder |
VolumeBuilder holds the metadata (e.g., the storage directories) of the
prepared volume returned from
prepareVolume(DataNode, StorageLocation, List). |
Storage.FormatConfirmable, Storage.StorageDirectory, Storage.StorageDirType, Storage.StorageState| Modifier and Type | Field | Description |
|---|---|---|
static java.lang.String |
BLOCK_SUBDIR_PREFIX |
|
static java.lang.String |
STORAGE_DIR_FINALIZED |
|
static java.lang.String |
STORAGE_DIR_LAZY_PERSIST |
|
static java.lang.String |
STORAGE_DIR_RBW |
|
static java.lang.String |
STORAGE_DIR_TMP |
LAST_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 |
|---|---|
DataStorage(StorageInfo storageInfo) |
| Modifier and Type | Method | Description |
|---|---|---|
void |
clearRollingUpgradeMarker(java.lang.String bpid) |
|
void |
clearTrash(java.lang.String bpid) |
|
static boolean |
createStorageID(Storage.StorageDirectory sd,
boolean regenerateStorageIds,
org.apache.hadoop.conf.Configuration conf) |
Create an ID for this storage.
|
void |
enableTrash(java.lang.String bpid) |
Enable trash for the specified block pool storage.
|
static boolean |
fullyDelete(java.io.File dir) |
Deprecated.
|
BlockPoolSliceStorage |
getBPStorage(java.lang.String bpid) |
|
java.lang.String |
getDatanodeUuid() |
|
java.lang.String |
getTrashDirectoryForReplica(java.lang.String bpid,
ReplicaInfo info) |
If rolling upgrades are in progress then do not delete block files
immediately.
|
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.
|
DataStorage.VolumeBuilder |
prepareVolume(DataNode datanode,
StorageLocation location,
java.util.List<NamespaceInfo> nsInfos) |
Prepare a storage directory.
|
void |
setDatanodeUuid(java.lang.String newDatanodeUuid) |
|
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 common storage fields into the given properties object.
|
void |
setRollingUpgradeMarker(java.lang.String bpid) |
|
boolean |
trashEnabled(java.lang.String bpid) |
addStorageDir, 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, toString, versionSupportsFederationpublic static final java.lang.String BLOCK_SUBDIR_PREFIX
public static final java.lang.String STORAGE_DIR_RBW
public static final java.lang.String STORAGE_DIR_FINALIZED
public static final java.lang.String STORAGE_DIR_LAZY_PERSIST
public static final java.lang.String STORAGE_DIR_TMP
public DataStorage(StorageInfo storageInfo)
public BlockPoolSliceStorage getBPStorage(java.lang.String bpid)
public java.lang.String getDatanodeUuid()
public void setDatanodeUuid(java.lang.String newDatanodeUuid)
public static boolean createStorageID(Storage.StorageDirectory sd, boolean regenerateStorageIds, org.apache.hadoop.conf.Configuration conf)
public void enableTrash(java.lang.String bpid)
public void clearTrash(java.lang.String bpid)
public boolean trashEnabled(java.lang.String bpid)
public void setRollingUpgradeMarker(java.lang.String bpid)
throws java.io.IOException
java.io.IOExceptionpublic void clearRollingUpgradeMarker(java.lang.String bpid)
throws java.io.IOException
java.io.IOExceptionpublic java.lang.String getTrashDirectoryForReplica(java.lang.String bpid,
ReplicaInfo info)
public DataStorage.VolumeBuilder prepareVolume(DataNode datanode, StorageLocation location, java.util.List<NamespaceInfo> nsInfos) throws java.io.IOException
datanode - DataNode object.location - the StorageLocation for the storage directory.nsInfos - an array of namespace infos.java.io.IOException - if encounters I/O errors.
Note that if there is IOException, the state of DataStorage is not modified.protected void setPropertiesFromFields(java.util.Properties props,
Storage.StorageDirectory sd)
throws java.io.IOException
StoragesetPropertiesFromFields 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 boolean isPreUpgradableLayout(Storage.StorageDirectory sd) throws java.io.IOException
StorageisPreUpgradableLayout in class Storagejava.io.IOException@Deprecated public static boolean fullyDelete(java.io.File dir)
dir - Copyright © 2008–2025 Apache Software Foundation. All rights reserved.