CheckpointSignature, NamenodeRegistration, NamespaceInfo, Storage@Private
public class StorageInfo
extends java.lang.Object
| Modifier and Type | Field | Description |
|---|---|---|
java.lang.String |
clusterID |
|
long |
cTime |
|
int |
layoutVersion |
|
int |
namespaceID |
|
protected static java.lang.String |
STORAGE_FILE_VERSION |
|
protected HdfsServerConstants.NodeType |
storageType |
| Constructor | Description |
|---|---|
StorageInfo(int layoutV,
int nsID,
java.lang.String cid,
long cT,
HdfsServerConstants.NodeType type) |
|
StorageInfo(HdfsServerConstants.NodeType type) |
|
StorageInfo(StorageInfo from) |
| Modifier and Type | Method | Description |
|---|---|---|
protected void |
checkStorageType(java.util.Properties props,
Storage.StorageDirectory sd) |
Validate and set storage type from
Properties |
java.lang.String |
getClusterID() |
cluster id of the file system.
|
static java.lang.String |
getClusterIdFromColonSeparatedString(java.lang.String in) |
|
long |
getCTime() |
Creation time of the file system state.
|
int |
getLayoutVersion() |
Layout version of the storage data.
|
int |
getNamespaceID() |
Namespace id of the file system.
|
static int |
getNsIdFromColonSeparatedString(java.lang.String in) |
|
protected static java.lang.String |
getProperty(java.util.Properties props,
Storage.StorageDirectory sd,
java.lang.String name) |
|
java.util.Map<java.lang.Integer,java.util.SortedSet<LayoutVersion.LayoutFeature>> |
getServiceLayoutFeatureMap() |
|
int |
getServiceLayoutVersion() |
|
void |
readPreviousVersionProperties(Storage.StorageDirectory sd) |
Read properties from the the previous/VERSION file in the given storage directory.
|
void |
readProperties(Storage.StorageDirectory sd) |
Read properties from the VERSION file in the given storage directory.
|
static java.util.Properties |
readPropertiesFile(java.io.File from) |
|
protected void |
setClusterId(java.util.Properties props,
int layoutVersion,
Storage.StorageDirectory sd) |
Validate and set clusterId from
Properties |
protected void |
setcTime(java.util.Properties props,
Storage.StorageDirectory sd) |
Validate and set ctime from
Properties |
protected void |
setFieldsFromProperties(java.util.Properties props,
Storage.StorageDirectory sd) |
Get common storage fields.
|
protected void |
setLayoutVersion(java.util.Properties props,
Storage.StorageDirectory sd) |
Validate and set layout version from
Properties |
protected void |
setNamespaceID(java.util.Properties props,
Storage.StorageDirectory sd) |
Validate and set namespaceID version from
Properties |
void |
setServiceLayoutVersion(int lv) |
|
void |
setStorageInfo(StorageInfo from) |
|
java.lang.String |
toColonSeparatedString() |
|
java.lang.String |
toMapString() |
Returns string representation of Storage info attributes stored in Map.
|
java.lang.String |
toString() |
|
boolean |
versionSupportsFederation(java.util.Map<java.lang.Integer,java.util.SortedSet<LayoutVersion.LayoutFeature>> map) |
public int layoutVersion
public int namespaceID
public java.lang.String clusterID
public long cTime
protected final HdfsServerConstants.NodeType storageType
protected static final java.lang.String STORAGE_FILE_VERSION
public StorageInfo(HdfsServerConstants.NodeType type)
public StorageInfo(int layoutV,
int nsID,
java.lang.String cid,
long cT,
HdfsServerConstants.NodeType type)
public StorageInfo(StorageInfo from)
public int getLayoutVersion()
public int getNamespaceID()
Assigned to the file system at formatting and never changes after that. Shared by all file system components.
public java.lang.String getClusterID()
public long getCTime()
Modified during upgrades.
public void setStorageInfo(StorageInfo from)
public boolean versionSupportsFederation(java.util.Map<java.lang.Integer,java.util.SortedSet<LayoutVersion.LayoutFeature>> map)
public java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String toMapString()
public java.lang.String toColonSeparatedString()
public static int getNsIdFromColonSeparatedString(java.lang.String in)
public static java.lang.String getClusterIdFromColonSeparatedString(java.lang.String in)
public void readProperties(Storage.StorageDirectory sd) throws java.io.IOException
java.io.IOExceptionpublic void readPreviousVersionProperties(Storage.StorageDirectory sd) throws java.io.IOException
java.io.IOExceptionprotected void setFieldsFromProperties(java.util.Properties props,
Storage.StorageDirectory sd)
throws java.io.IOException
props - propertiesjava.io.IOException - on errorprotected void checkStorageType(java.util.Properties props,
Storage.StorageDirectory sd)
throws InconsistentFSStateException
PropertiesInconsistentFSStateExceptionprotected void setcTime(java.util.Properties props,
Storage.StorageDirectory sd)
throws InconsistentFSStateException
PropertiesInconsistentFSStateExceptionprotected void setClusterId(java.util.Properties props,
int layoutVersion,
Storage.StorageDirectory sd)
throws InconsistentFSStateException
PropertiesInconsistentFSStateExceptionprotected void setLayoutVersion(java.util.Properties props,
Storage.StorageDirectory sd)
throws IncorrectVersionException,
InconsistentFSStateException
Propertiesprotected void setNamespaceID(java.util.Properties props,
Storage.StorageDirectory sd)
throws InconsistentFSStateException
PropertiesInconsistentFSStateExceptionpublic void setServiceLayoutVersion(int lv)
public int getServiceLayoutVersion()
public java.util.Map<java.lang.Integer,java.util.SortedSet<LayoutVersion.LayoutFeature>> getServiceLayoutFeatureMap()
protected static java.lang.String getProperty(java.util.Properties props,
Storage.StorageDirectory sd,
java.lang.String name)
throws InconsistentFSStateException
InconsistentFSStateExceptionpublic static java.util.Properties readPropertiesFile(java.io.File from)
throws java.io.IOException
java.io.IOExceptionCopyright © 2008–2025 Apache Software Foundation. All rights reserved.