All Products
Search
Document Center

E-MapReduce:JindoCache CLI usage notes

Last Updated:Dec 21, 2023

This topic describes how to use JindoCache-related commands.

Prerequisites

JindoCache is configured. For more information, see Use the transparent caching feature of JindoCache to accelerate access to OSS-HDFS and Use the transparent caching feature of JindoCache to accelerate access to OSS.

Usage summary

You can run the jindocache command to view the supported commands and information about how to use the commands.

listCacheSet

  • Description: Lists all CacheSets in the current system.

  • Syntax:

    jindocache -listCacheSet

refreshCacheSet

  • Description: Updates a CacheSet policy. CacheSets that do not exist in the new policy file are deleted.

  • Syntax:

    jindocache -refreshCacheSet <localPath>

    The following table describes the parameter in the command.

    Parameter

    Description

    <localPath>

    The path of the cacheset.xml file. Example: /path/cacheset.xml.

    The path is the storage path that you specified when you created the cacheset.xml file.

  • Sample command:

    jindocache -refreshCacheSet /path/cacheset.xml

load

Caching commands include metadata caching commands and data caching commands. The command format is jindocache -load [-meta] [-data] [-s] [-m] [-R] [-replica value] <path>.

  • Metadata caching

    • Description: Caches the metadata of remote files to local disks. This way, you can read the metadata from the local disks instead of backend storage systems such as Object Storage Service (OSS).

    • Syntax:

      jindocache -load -meta <options> <path>

      The following table describes the parameters in the command.

      Parameter

      Description

      <options>

      Optional parameters:

      • -s: executes the caching process in synchronous mode. If you configure this parameter, the command does not exit until caching is complete, and the log is displayed in the console. We recommend that you configure this parameter.

      • -R: recursively caches all files in a folder. If the value of the path parameter is a folder, you must configure this parameter.

      <path>

      The path to which you want to cache metadata. Example: oss://emr-test /dir1.

      We recommend that you use the following command:

      jindocache -load -meta -s -R <path>
  • Data caching

    • Description: Caches data that is stored in a specific path to local disks. This way, you can read the data from the local disks instead of backend storage systems such as OSS.

    • Syntax:

      jindocache -load -data <options> <path>

      The following table describes the parameters in the command.

      Parameter

      Description

      <options>

      Optional parameters:

      • -s: executes the caching process in synchronous mode. If you configure this parameter, the command does not exit until caching is complete, and the log is displayed in the console. We recommend that you configure this parameter.

      • -replica: the number of replicas that you want to cache. By default, only one replica is cached.

      • -R: recursively caches all files in a folder. If the value of the path parameter is a folder, you must configure this parameter.

      • -m: loads data into the memory.

      <path>

      The path to which you want to cache data. Example: oss://emr-test /dir1.

      We recommend that you use the following command:

      jindocache -load -data -s -R <path>

mount

  • Description: mounts a backend path to the caching system. You can run the jindocache -mount command to view all mount points.

  • Syntax:

    jindocache -mount <mountpoint> <path>

    The following table describes the parameters in the command.

    Parameter

    Description

    <mountpoint>

    The backend path that you want to mount. Example: /mount/dir.

    <path>

    The path to which you want to cache metadata. Example: oss://emr-test /dir1.

  • Sample command:

    jindocache -mount /mount/dir oss://emr-test/dir1

umount

  • Description: Unmounts a mount point.

  • Syntax:

    jindocache -unmount <mountpoint>
  • Sample command:

    jindocache -unmount /mount/dir

report

  • Description: Queries information about the JindoCache storage acceleration system, such as the number of nodes, the cache size, and the cache capacity.

  • Sample command:

    jindocache -report

reportMetrics

  • Description: Queries some of the metrics of the JindoCache storage acceleration system.

  • Syntax:

    jindocache -reportMetrics

unCache

  • Description: Deletes cached files from the caching system.

  • Syntax:

    jindocache -unCache oss://<bucket>/<dir>
  • Sample command:

    jindocache -unCache oss://emr-test/dir1

disableCacheSet

  • Description: Deletes a CacheSet based on the CacheSet name.

  • Syntax:

    jindocache -disableCacheSet <name>
  • Sample command:

    jindocache -disableCacheSet name1

getCacheSet

  • Description: Queries a CacheSet based on the path to which the CacheSet belongs.

  • Syntax:

    jindocache -getCacheSet <path>
  • Sample command:

    jindocache -getCacheSet oss://emr-test/dir1