@NotThreadSafe public final class DefaultStorageTier extends Object implements StorageTier
StorageDir
which actually contains metadata information about blocks stored and space
used/available.Modifier and Type | Method and Description |
---|---|
long |
getAvailableBytes() |
long |
getCapacityBytes() |
StorageDir |
getDir(int dirIndex)
Returns a directory for the given index.
|
List<String> |
getLostStorage() |
List<StorageDir> |
getStorageDirs() |
String |
getTierAlias() |
int |
getTierOrdinal() |
static StorageTier |
newStorageTier(String tierAlias,
int tierOrdinal,
boolean isMultiTier)
Factory method to create
StorageTier . |
void |
removeStorageDir(StorageDir dir)
Removes a directory.
|
public static StorageTier newStorageTier(String tierAlias, int tierOrdinal, boolean isMultiTier)
StorageTier
.tierAlias
- the tier aliastierOrdinal
- the tier ordinalisMultiTier
- whether this tier is part of a multi-tier setuppublic int getTierOrdinal()
getTierOrdinal
in interface StorageTier
public String getTierAlias()
getTierAlias
in interface StorageTier
public long getCapacityBytes()
getCapacityBytes
in interface StorageTier
public long getAvailableBytes()
getAvailableBytes
in interface StorageTier
@Nullable public StorageDir getDir(int dirIndex)
StorageTier
getDir
in interface StorageTier
dirIndex
- the directory indexpublic List<StorageDir> getStorageDirs()
getStorageDirs
in interface StorageTier
public List<String> getLostStorage()
getLostStorage
in interface StorageTier
public void removeStorageDir(StorageDir dir)
StorageTier
removeStorageDir
in interface StorageTier
dir
- directory to be removedIllegalArgumentException
- if dir does not belong to this tierCopyright © 2023. All Rights Reserved.