BlockStoragePolicySpi (Apache Hadoop Common 3.5.0 API)
Description: declaration: package: org.apache.hadoop.fs, interface: BlockStoragePolicySpi

Package org.apache.hadoop.fs

# Interface BlockStoragePolicySpi

@Public @Stable public interface BlockStoragePolicySpi
A storage policy specifies the placement of block replicas on specific storage types.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `StorageType[]`
  `getCreationFallbacks()`
  Get the fallback storage types for creating new block replicas.
  `String`
  `getName()`
  Return the name of the storage policy.
  `StorageType[]`
  `getReplicationFallbacks()`
  Get the fallback storage types for replicating existing block replicas.
  `StorageType[]`
  `getStorageTypes()`
  Return the preferred storage types associated with this policy.
  `boolean`
  `isCopyOnCreateFile()`
  Returns true if the policy is inherit-only and cannot be changed for an existing file.

- ## Method Details

  - ### getName

    String getName()
    Return the name of the storage policy. Policies are uniquely identified by name.
    Returns:
      the name of the storage policy.

  - ### getStorageTypes

    StorageType[] getStorageTypes()
    Return the preferred storage types associated with this policy. These storage types are used sequentially for successive block replicas.
    Returns:
      preferred storage types used for placing block replicas.

  - ### getCreationFallbacks

    StorageType[] getCreationFallbacks()
    Get the fallback storage types for creating new block replicas. Fallback storage types are used if the preferred storage types are not available.
    Returns:
      fallback storage types for new block replicas..

  - ### getReplicationFallbacks

    StorageType[] getReplicationFallbacks()
    Get the fallback storage types for replicating existing block replicas. Fallback storage types are used if the preferred storage types are not available.
    Returns:
      fallback storage types for replicating existing block replicas.

  - ### isCopyOnCreateFile

    boolean isCopyOnCreateFile()
    Returns true if the policy is inherit-only and cannot be changed for an existing file.
    Returns:
      true if the policy is inherit-only.