The JindoTable access frequency statistics collection feature helps you distinguish between cold and hot data, reducing overall storage costs and improving cache efficiency.
Prerequisites
A cluster has been created. For more information, see Create a cluster.
Background information
JindoTable collects access records for Hive tables. The collected data is stored in the namespace of the SmartData service.
SmartData 3.2.x and later supports the Spark, Hive, and Presto engines. By default, access frequency statistics collection is enabled for Spark and Presto but disabled for Hive. To disable this feature, see Disable heat collection. To enable this feature for Hive, see Enable heat collection for Hive.
Data query
- Syntax
jindo table -accessStat <-d [days]> <-n [topNums]>The
daysandtopNumsparameters are positive integers. If you setdaysto 1, the command queries all access records from 00:00 local time on the current day to the current time. - Function
Queries the top N most frequently accessed tables or partitions within a specified time range.
- Example: Query the 20 most frequently accessed tables or partitions in the last seven days.
jindo table -accessStat -d 7 -n 20
For more information about using JindoTable, see JindoTable User Guide.
Enable heat collection for Hive
- Log on to the E-MapReduce console.
- In the top navigation bar, select a region and resource group.
- Click the Clusters tab.
- On the Clusters page, find your cluster and click Details in the Actions column.
- Modify a Hive parameter.
- In the navigation pane on the left, choose .
- Click the Configure tab.
- Search for the hive.exec.post.hooks parameter and append com.aliyun.emr.table.hive.HivePostHook to its value. If other values exist, use a comma (,) as a separator.
- Save the configuration.
- In the upper-right corner, click Save.
- In the Confirm dialog box, enter a Execution Reason and turn on Auto-update Configuration.
- Click OK.
- Restart the service.
- On the Hive service page, choose from the upper-right corner.
- In the Cluster Activities dialog box, enter a Execution Reason.
- Click OK.
- ConfirmIn the confirmation dialog box, click OK.
Disable heat collection
- Log on to the E-MapReduce console.
- In the top navigation bar, select a region and resource group.
- Click the Clusters tab.
- On the Clusters page, find your cluster and click Details in the Actions column.
- Modify the parameter values.
- Hive service:
- In the navigation pane on the left, choose .
- Click the Configure tab.
- Search for the hive.exec.post.hooks parameter and remove com.aliyun.emr.table.hive.HivePostHook from its value.
- Spark service:
- In the navigation pane on the left, choose .
- Click the Configure tab.
- Search for the spark.sql.queryExecutionListeners parameter and remove com.aliyun.emr.table.spark.SparkSQLQueryListener from its value.
- Presto service:
- In the navigation pane on the left, choose .
- Click the Configure tab.
- Search for the event-listener.name parameter and clear its value.
- Hive service:
- Save the configuration.
- In the upper-right corner, click Save.
- In the Confirm dialog box, enter a Execution Reason and turn on Auto-update Configuration.
- Click OK.
- Restart the services.
- Hive service:
- On the Hive service page, choose from the upper-right corner.
- In the Cluster Activities dialog box, enter a Execution Reason.
- Click OK.
- ConfirmIn the confirmation dialog box, click OK.
- Spark service:
- On the Spark service page, choose from the upper-right corner.
- In the Cluster Activities dialog box, enter a Execution Reason.
- Click OK.
- ConfirmIn the confirmation dialog box, click OK.
- Presto service:
- On the Presto service page, choose from the upper-right corner.
- In the Cluster Activities dialog box, enter a Execution Reason.
- Click OK.
- ConfirmIn the confirmation dialog box, click OK.
- Hive service: