public class StorageTier extends Object
Constructor and Description |
---|
StorageTier(int storageLevel,
StorageLevelAlias storageLevelAlias,
String[] dirPaths,
long[] dirCapacityBytes,
String dataFolder,
String userTempFolder,
StorageTier nextTier,
Object conf)
Creates a new StorageTier
|
Modifier and Type | Method and Description |
---|---|
boolean |
containsBlock(long blockId)
Check whether certain block exists in current StorageTier
|
StorageLevelAlias |
getAlias()
Get the alias of the StorageTier's storage level
|
long |
getCapacityBytes()
Get capacity of current StorageTier in bytes
|
int |
getLevel()
Get the storage level of the StorageTier
|
StorageTier |
getNextStorageTier()
Get next StorageTier
|
StorageDir |
getStorageDirByBlockId(long blockId)
Find the StorageDir which contains the given block Id
|
StorageDir |
getStorageDirByIndex(int dirIndex)
Get StorageDir by array index
|
StorageDir[] |
getStorageDirs()
Get StorageDirs in current StorageTier
|
long |
getUsedBytes()
Get used space in the StorageTier
|
void |
initialize()
Initialize StorageDirs in current StorageTier
|
boolean |
isLastTier()
Check whether the StorageTier is the last tier
|
StorageDir |
requestSpace(long userId,
long requestBytes,
Set<Integer> pinList,
List<Long> removedBlockIds)
Request space from any StorageDir in the StorageTier.
|
boolean |
requestSpace(StorageDir storageDir,
long userId,
long requestBytes,
Set<Integer> pinList,
List<Long> removedBlockIds)
Request space from specified StorageDir in the StorageTier.
|
String |
toString() |
public StorageTier(int storageLevel, StorageLevelAlias storageLevelAlias, String[] dirPaths, long[] dirCapacityBytes, String dataFolder, String userTempFolder, StorageTier nextTier, Object conf) throws IOException
storageLevel
- the level of the StorageTierstorageLevelAlias
- the alias of the StorageTier's storage leveldirPaths
- paths of StorageDirs in the StorageTierdirCapacityBytes
- capacities of StorageDirs in the StorageTierdataFolder
- data folder in the StorageDiruserTempFolder
- user temporary folder in the StorageDirnextTier
- the successor StorageTierconf
- configuration of StorageDirIOException
public boolean containsBlock(long blockId)
blockId
- id of the blockpublic long getCapacityBytes()
public StorageTier getNextStorageTier()
public StorageDir getStorageDirByBlockId(long blockId)
blockId
- the id of the blockpublic StorageDir getStorageDirByIndex(int dirIndex)
dirIndex
- index of the StorageDirpublic StorageDir[] getStorageDirs()
public int getLevel()
public StorageLevelAlias getAlias()
public long getUsedBytes()
public void initialize() throws IOException
IOException
public boolean isLastTier()
public StorageDir requestSpace(long userId, long requestBytes, Set<Integer> pinList, List<Long> removedBlockIds) throws IOException
userId
- the id of the userrequestBytes
- requested space in bytespinList
- list of pinned filesremovedBlockIds
- list of blocks which are removed from TachyonIOException
public boolean requestSpace(StorageDir storageDir, long userId, long requestBytes, Set<Integer> pinList, List<Long> removedBlockIds) throws IOException
storageDir
- StorageDir that the space will be allocated inuserId
- id of the userrequestBytes
- size to request in bytespinList
- list of pinned filesremovedBlockIds
- list of blocks which are removed from TachyonIOException
Copyright © 2015. All Rights Reserved.