Class CachePoolInfo

java.lang.Object
org.apache.hadoop.hdfs.protocol.CachePoolInfo

@Public @Evolving public class CachePoolInfo extends Object
CachePoolInfo describes a cache pool. This class is used in RPCs to create and modify cache pools. It is serializable and can be stored in the edit log.
  • Field Details

    • RELATIVE_EXPIRY_NEVER

      public static final long RELATIVE_EXPIRY_NEVER
      Indicates that the pool does not have a maximum relative expiry.
      See Also:
    • DEFAULT_MAX_RELATIVE_EXPIRY

      public static final long DEFAULT_MAX_RELATIVE_EXPIRY
      Default max relative expiry for cache pools.
      See Also:
    • LIMIT_UNLIMITED

      public static final long LIMIT_UNLIMITED
      See Also:
    • DEFAULT_LIMIT

      public static final long DEFAULT_LIMIT
      See Also:
    • DEFAULT_REPLICATION_NUM

      public static final short DEFAULT_REPLICATION_NUM
      See Also:
  • Constructor Details

    • CachePoolInfo

      public CachePoolInfo(String poolName)
  • Method Details

    • getPoolName

      public String getPoolName()
      Returns:
      Name of the pool.
    • getOwnerName

      public String getOwnerName()
      Returns:
      The owner of the pool. Along with the group and mode, determines who has access to view and modify the pool.
    • setOwnerName

      public CachePoolInfo setOwnerName(String ownerName)
    • getGroupName

      public String getGroupName()
      Returns:
      The group of the pool. Along with the owner and mode, determines who has access to view and modify the pool.
    • setGroupName

      public CachePoolInfo setGroupName(String groupName)
    • getMode

      public FsPermission getMode()
      Returns:
      Unix-style permissions of the pool. Along with the owner and group, determines who has access to view and modify the pool.
    • setMode

      public CachePoolInfo setMode(FsPermission mode)
    • getLimit

      public Long getLimit()
      Returns:
      The maximum aggregate number of bytes that can be cached by directives in this pool.
    • setLimit

      public CachePoolInfo setLimit(Long bytes)
    • getDefaultReplication

      public Short getDefaultReplication()
      Returns:
      The default replication num for CacheDirective in this pool
    • setDefaultReplication

      public CachePoolInfo setDefaultReplication(Short repl)
    • getMaxRelativeExpiryMs

      public Long getMaxRelativeExpiryMs()
      Returns:
      The maximum relative expiration of directives of this pool in milliseconds
    • setMaxRelativeExpiryMs

      public CachePoolInfo setMaxRelativeExpiryMs(Long ms)
      Set the maximum relative expiration of directives of this pool in milliseconds.
      Parameters:
      ms - in milliseconds
      Returns:
      This builder, for call chaining.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • validate

      public static void validate(CachePoolInfo info) throws IOException
      Throws:
      IOException
    • validateName

      public static void validateName(String poolName) throws IOException
      Throws:
      IOException