6.2. Cache Directive Commands

  • addDirective

    Adds a new Cache Directive.

    Usage:

    hdfs cacheadmin -addDirective -path <path> -pool <pool-name> [-force] 
    [-replication <replication>] [-ttl <time-to-live>]

    Options:

    Option Description
    <path> The path to the cache directory or file.
    <pool-name> The Cache Pool to which the Cache Directive will be added. You must have Write permission for the Cache Pool in order to add new directives.
    <-force> Skips checking of Cache Pool resource limits.
    <replication> The UNIX-style permissions assigned to the pool. Permissions are specified in octal, e.g., 0755. Pool permissions are set to 0755 by default.  
    <limit> The cache replication factor to use. Defaults to 1.
    <time-to-live> How long the directive is valid. This can be specified in minutes, hours, and days, e.g., 30m, 4h, 2d. Valid units are [smhd]. A value of "never" indicates a directive that never expires. If unspecified, the directive never expires.

  • removeDirective

    Removes a Cache Directive.

    Usage:

    hdfs cacheadmin -removeDirective <id>

    Options:

    Option Description
    <id> The ID of the Cache Directive to remove. You must have Write permission for the pool that the directive belongs to in order to remove it. You can use the -listDirectives command to display a list of Cache Directive IDs.

  • removeDirectives

    Removes all of the Cache Directives in a specified path.

    Usage:

    hdfs cacheadmin -removeDirectives <path>

    Options:

    Option Description
    <path> The path of the Cache Directives to remove. You must have Write permission for the pool that the directives belong to in order to remove them. You can use the -listDirectives command to display a list of Cache Directives.

  • listDirectives

    Returns a list of Cache Directives.

    Usage:

    hdfs cacheadmin -listDirectives [-stats] [-path <path>] [-pool <pool>]

    Options:

    Option Description
    <path> List only the Cache Directives in this path. Note that if there is a Cache Directive in the <path> that belongs to a Cache Pool for which you do not have Read access, it will not be listed.
    <pool> Only list the Cache Directives in the specified Cache Pool.
    <-stats> List path-based Cache Directive statistics.


loading table of contents...