@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,
boolean isMultiTier)
Factory method to create
StorageTier . |
void |
removeStorageDir(StorageDir dir)
Removes a directory.
|
public static StorageTier newStorageTier(String tierAlias, boolean isMultiTier) throws BlockAlreadyExistsException, IOException, WorkerOutOfSpaceException
StorageTier
.tierAlias
- the tier aliasisMultiTier
- whether this tier is part of a multi-tier setupBlockAlreadyExistsException
- if the tier already existsWorkerOutOfSpaceException
- if there is not enough space availableIOException
public 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 removedCopyright © 2023. All Rights Reserved.