org.apache.hadoop.fs.BlockStoragePolicySpi@Private
public class BlockStoragePolicy
extends java.lang.Object
implements org.apache.hadoop.fs.BlockStoragePolicySpi
| Modifier and Type | Field | Description |
|---|---|---|
static org.slf4j.Logger |
LOG |
| Constructor | Description |
|---|---|
BlockStoragePolicy(byte id,
java.lang.String name,
org.apache.hadoop.fs.StorageType[] storageTypes,
org.apache.hadoop.fs.StorageType[] creationFallbacks,
org.apache.hadoop.fs.StorageType[] replicationFallbacks) |
|
BlockStoragePolicy(byte id,
java.lang.String name,
org.apache.hadoop.fs.StorageType[] storageTypes,
org.apache.hadoop.fs.StorageType[] creationFallbacks,
org.apache.hadoop.fs.StorageType[] replicationFallbacks,
boolean copyOnCreateFile) |
| Modifier and Type | Method | Description |
|---|---|---|
java.util.List<org.apache.hadoop.fs.StorageType> |
chooseExcess(short replication,
java.lang.Iterable<org.apache.hadoop.fs.StorageType> chosen) |
Choose excess storage types for deletion, given the
replication number and the storage types of the chosen replicas.
|
java.util.List<org.apache.hadoop.fs.StorageType> |
chooseStorageTypes(short replication) |
|
java.util.List<org.apache.hadoop.fs.StorageType> |
chooseStorageTypes(short replication,
java.lang.Iterable<org.apache.hadoop.fs.StorageType> chosen) |
Choose the storage types for storing the remaining replicas, given the
replication number and the storage types of the chosen replicas.
|
java.util.List<org.apache.hadoop.fs.StorageType> |
chooseStorageTypes(short replication,
java.lang.Iterable<org.apache.hadoop.fs.StorageType> chosen,
java.util.EnumSet<org.apache.hadoop.fs.StorageType> unavailables,
boolean isNewBlock) |
Choose the storage types for storing the remaining replicas, given the
replication number, the storage types of the chosen replicas and
the unavailable storage types.
|
boolean |
equals(java.lang.Object obj) |
|
org.apache.hadoop.fs.StorageType |
getCreationFallback(java.util.EnumSet<org.apache.hadoop.fs.StorageType> unavailables) |
|
org.apache.hadoop.fs.StorageType[] |
getCreationFallbacks() |
|
byte |
getId() |
|
java.lang.String |
getName() |
|
org.apache.hadoop.fs.StorageType |
getReplicationFallback(java.util.EnumSet<org.apache.hadoop.fs.StorageType> unavailables) |
|
org.apache.hadoop.fs.StorageType[] |
getReplicationFallbacks() |
|
org.apache.hadoop.fs.StorageType[] |
getStorageTypes() |
|
int |
hashCode() |
|
boolean |
isCopyOnCreateFile() |
|
java.lang.String |
toString() |
@VisibleForTesting
public BlockStoragePolicy(byte id,
java.lang.String name,
org.apache.hadoop.fs.StorageType[] storageTypes,
org.apache.hadoop.fs.StorageType[] creationFallbacks,
org.apache.hadoop.fs.StorageType[] replicationFallbacks)
@VisibleForTesting
public BlockStoragePolicy(byte id,
java.lang.String name,
org.apache.hadoop.fs.StorageType[] storageTypes,
org.apache.hadoop.fs.StorageType[] creationFallbacks,
org.apache.hadoop.fs.StorageType[] replicationFallbacks,
boolean copyOnCreateFile)
public java.util.List<org.apache.hadoop.fs.StorageType> chooseStorageTypes(short replication)
StorageTypes for storing the replicas of a block.public java.util.List<org.apache.hadoop.fs.StorageType> chooseStorageTypes(short replication,
java.lang.Iterable<org.apache.hadoop.fs.StorageType> chosen)
replication - the replication number.chosen - the storage types of the chosen replicas.StorageTypes for storing the replicas of a block.public java.util.List<org.apache.hadoop.fs.StorageType> chooseStorageTypes(short replication,
java.lang.Iterable<org.apache.hadoop.fs.StorageType> chosen,
java.util.EnumSet<org.apache.hadoop.fs.StorageType> unavailables,
boolean isNewBlock)
replication - the replication number.chosen - the storage types of the chosen replicas.unavailables - the unavailable storage types.isNewBlock - Is it for new block creation?StorageTypes for storing the replicas of a block.public java.util.List<org.apache.hadoop.fs.StorageType> chooseExcess(short replication,
java.lang.Iterable<org.apache.hadoop.fs.StorageType> chosen)
replication - the replication number.chosen - the storage types of the chosen replicas.StorageTypes for deletion.public org.apache.hadoop.fs.StorageType getCreationFallback(java.util.EnumSet<org.apache.hadoop.fs.StorageType> unavailables)
StorageType for creation.public org.apache.hadoop.fs.StorageType getReplicationFallback(java.util.EnumSet<org.apache.hadoop.fs.StorageType> unavailables)
StorageType for replication.public int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Objectpublic byte getId()
public java.lang.String getName()
getName in interface org.apache.hadoop.fs.BlockStoragePolicySpipublic org.apache.hadoop.fs.StorageType[] getStorageTypes()
getStorageTypes in interface org.apache.hadoop.fs.BlockStoragePolicySpipublic org.apache.hadoop.fs.StorageType[] getCreationFallbacks()
getCreationFallbacks in interface org.apache.hadoop.fs.BlockStoragePolicySpipublic org.apache.hadoop.fs.StorageType[] getReplicationFallbacks()
getReplicationFallbacks in interface org.apache.hadoop.fs.BlockStoragePolicySpipublic boolean isCopyOnCreateFile()
isCopyOnCreateFile in interface org.apache.hadoop.fs.BlockStoragePolicySpiCopyright © 2008–2025 Apache Software Foundation. All rights reserved.